Class: CanTango::PermissionEngine::Selector::Licenses
- Defined in:
- lib/cantango/permission_engine/selector/licenses.rb
Instance Attribute Summary collapse
-
#role_groups ⇒ Object
readonly
Returns the value of attribute role_groups.
-
#roles ⇒ Object
readonly
Returns the value of attribute roles.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(subject) ⇒ Licenses
constructor
A new instance of Licenses.
- #relevant?(permission) ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(subject) ⇒ Licenses
Returns a new instance of Licenses.
7 8 9 10 |
# File 'lib/cantango/permission_engine/selector/licenses.rb', line 7 def initialize subject @roles = subject.roles_list @role_groups = subject.role_groups_list end |
Instance Attribute Details
#role_groups ⇒ Object (readonly)
Returns the value of attribute role_groups.
5 6 7 |
# File 'lib/cantango/permission_engine/selector/licenses.rb', line 5 def role_groups @role_groups end |
#roles ⇒ Object (readonly)
Returns the value of attribute roles.
5 6 7 |
# File 'lib/cantango/permission_engine/selector/licenses.rb', line 5 def roles @roles end |
Instance Method Details
#relevant?(permission) ⇒ Boolean
12 13 14 |
# File 'lib/cantango/permission_engine/selector/licenses.rb', line 12 def relevant? (roles | role_groups).include? .to_sym end |