Module: Acl9::ModelExtensions::Object
- Defined in:
- lib/acl9/model_extensions/object.rb
Instance Method Summary collapse
-
#accepted_roles_by(subject) ⇒ Array<Role>
Which roles does
subject
have on this object?. -
#accepts_no_role!(role_name, subject) ⇒ Object
Free specified subject of a role on this object.
-
#accepts_role!(role_name, subject) ⇒ Object
Add role on the object to specified subject.
-
#accepts_role?(role_name, subject) ⇒ Boolean
Role check.
-
#accepts_roles_by?(subject) ⇒ Boolean
(also: #accepts_role_by?)
Are there any roles for the specified
subject
on this object?.
Instance Method Details
#accepted_roles_by(subject) ⇒ Array<Role>
Which roles does subject
have on this object?
54 55 56 |
# File 'lib/acl9/model_extensions/object.rb', line 54 def accepted_roles_by(subject) subject.roles_for self end |
#accepts_no_role!(role_name, subject) ⇒ Object
Free specified subject of a role on this object.
32 33 34 |
# File 'lib/acl9/model_extensions/object.rb', line 32 def accepts_no_role!(role_name, subject) subject.has_no_role! role_name, self end |
#accepts_role!(role_name, subject) ⇒ Object
Add role on the object to specified subject.
22 23 24 |
# File 'lib/acl9/model_extensions/object.rb', line 22 def accepts_role!(role_name, subject) subject.has_role! role_name, self end |
#accepts_role?(role_name, subject) ⇒ Boolean
Role check.
12 13 14 |
# File 'lib/acl9/model_extensions/object.rb', line 12 def accepts_role?(role_name, subject) subject.has_role? role_name, self end |
#accepts_roles_by?(subject) ⇒ Boolean Also known as: accepts_role_by?
Are there any roles for the specified subject
on this object?
42 43 44 |
# File 'lib/acl9/model_extensions/object.rb', line 42 def accepts_roles_by?(subject) subject.has_roles_for? self end |