Module: Joinable::ActsAsPermissable::InstanceMethods
- Included in:
- Joinable::ActsAsJoinable::InstanceMethods, Joinable::ActsAsJoinableComponent::InstanceMethods
- Defined in:
- lib/joinable/acts_as_permissable.rb
Instance Method Summary collapse
- #acts_like_permissable? ⇒ Boolean
-
#who_can?(permission) ⇒ Boolean
Returns a list of users who either do or do not have the specified permission.
Instance Method Details
#acts_like_permissable? ⇒ Boolean
19 20 21 |
# File 'lib/joinable/acts_as_permissable.rb', line 19 def acts_like_permissable? true end |
#who_can?(permission) ⇒ Boolean
Returns a list of users who either do or do not have the specified permission.
24 25 26 |
# File 'lib/joinable/acts_as_permissable.rb', line 24 def who_can?() User.find_by_sql("SELECT * FROM users AS u1 WHERE #{self.class.with_permission_sql('u1.id', permission, :id_column => id)}") end |