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
34 35 36 |
# File 'lib/zuul/active_record/permission.rb', line 34 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
39 40 41 42 43 |
# File 'lib/zuul/active_record/permission.rb', line 39 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
46 47 48 49 50 |
# File 'lib/zuul/active_record/permission.rb', line 46 def subject_contexts auth_scope do send().group(:context_type, :context_id).map(&:context) end end |