Module: Zuul::ActiveRecord::Permission::InstanceMethods
- Defined in:
- lib/zuul/active_record/permission.rb
Instance Method Summary collapse
-
#assigned_contexts ⇒ Object
Returns a list of contexts within which the permission has been assigned to roles and/or subjects.
-
#role_contexts ⇒ Object
Returns a list of contexts within which the permission has been assigned to roles.
-
#subject_contexts ⇒ Object
Returns a list of contexts within which the permission has been assigned to subjects.
Instance Method Details
#assigned_contexts ⇒ Object
Returns a list of contexts within which the permission has been assigned to roles and/or subjects
35 36 37 |
# File 'lib/zuul/active_record/permission.rb', line 35 def assigned_contexts role_contexts.concat(subject_contexts).uniq end |
#role_contexts ⇒ Object
Returns a list of contexts within which the permission has been assigned to roles
40 41 42 43 44 |
# File 'lib/zuul/active_record/permission.rb', line 40 def role_contexts auth_scope do send().group(:context_type, :context_id).map(&:context) end end |
#subject_contexts ⇒ Object
Returns a list of contexts within which the permission has been assigned to subjects
47 48 49 50 51 |
# File 'lib/zuul/active_record/permission.rb', line 47 def subject_contexts auth_scope do send().group(:context_type, :context_id).map(&:context) end end |