module Maybee::AuthorizationObject
Public Instance Methods
allow?(access, subject = authorization_subject)
click to toggle source
# File lib/maybee/authorization_object.rb, line 39 def allow?(access, subject = authorization_subject) authorizations = self.class.authorizations[access] or return(false) authorizations.any? { |authorization| authorization.granted?(self, subject) } end
Private Instance Methods
wrap_callback_result_with_terminator(result)
click to toggle source
def with_authorization_to(access, object = self)
if authorization_user && authorization_user.may?(access, object) yield else false end
end
# File lib/maybee/authorization_object.rb, line 65 def wrap_callback_result_with_terminator(result) false == result ? throw(:abort) : result end