Module: RoleRequirementSystem::RoleSecurityInstanceMethods

Defined in:
lib/role_requirement_system.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



108
109
110
# File 'lib/role_requirement_system.rb', line 108

def self.included(klass)
  #raise "Because role_requirement extends acts_as_authenticated, You must include AuthenticatedSystem first before including RoleRequirementSystem!" unless klass.included_modules.include?(AuthenticatedSystem)
end

Instance Method Details

#check_rolesObject

We want to render something when access is denied, how does this make sense?

def access_denied

if logged_in?
  render :nothing => true, :status => 401
  return false
else
  super
end

end



123
124
125
126
127
# File 'lib/role_requirement_system.rb', line 123

def check_roles       
  return access_denied unless self.class.user_authorized_for?(current_user, params, binding)
  
  true
end