module Grant::Grantable::InstanceMethods
Public Instance Methods
grant_create()
click to toggle source
# File lib/grant/grantable.rb, line 33 def grant_create; grantor_create.authorize!(self); end
grant_destroy()
click to toggle source
# File lib/grant/grantable.rb, line 35 def grant_destroy; grantor_destroy.authorize!(self); end
grant_find()
click to toggle source
# File lib/grant/grantable.rb, line 32 def grant_find; grantor_find.authorize!(self); end
grant_update()
click to toggle source
# File lib/grant/grantable.rb, line 34 def grant_update; grantor_update.authorize!(self); end
granted?(action, user=Grant::User.current_user)
click to toggle source
# File lib/grant/grantable.rb, line 37 def granted?(action, user=Grant::User.current_user) grantor = send("grantor_#{action}") grantor.authorized?(self, user) end