Module: Grant::Grantable::InstanceMethods
- Defined in:
- lib/grant/grantable.rb
Instance Method Summary collapse
- #grant_create ⇒ Object
- #grant_destroy ⇒ Object
- #grant_find ⇒ Object
- #grant_update ⇒ Object
- #granted?(action, user = Grant::User.current_user) ⇒ Boolean
Instance Method Details
#grant_create ⇒ Object
33 |
# File 'lib/grant/grantable.rb', line 33 def grant_create; grantor_create.(self); end |
#grant_destroy ⇒ Object
35 |
# File 'lib/grant/grantable.rb', line 35 def grant_destroy; grantor_destroy.(self); end |
#grant_find ⇒ Object
32 |
# File 'lib/grant/grantable.rb', line 32 def grant_find; grantor_find.(self); end |
#grant_update ⇒ Object
34 |
# File 'lib/grant/grantable.rb', line 34 def grant_update; grantor_update.(self); end |
#granted?(action, user = Grant::User.current_user) ⇒ Boolean
37 38 39 40 |
# File 'lib/grant/grantable.rb', line 37 def granted?(action, user=Grant::User.current_user) grantor = send("grantor_#{action}") grantor.(self, user) end |