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