dannymcc/BaseApp2 — Issue #32: Problem with declarative_authorization
Author: swistaczek
Created: 2011-11-29 20:04:44+00:00
State: open

Hey guys,
Do you have problem with permissions on admin section? I logged in as user with admin role but d_a raises error.

Permission denied: No matching rules found for index for # (roles [:admin], privileges [:index], context :admin_dashboard).

This is auth rules:
authorization do
role :admin do
has_permission_on :authorization_rules, :to => :read

has_permission_on [
:admin_commits,
:admin_dashboard,
:admin_settings,
:admin_announcements,
:admin_delayed_jobs,
:admin_users
], :to => [:manage]

has_permission_on :admin_users, :to => [
:active, :search,:pending,:reset_password,:suspended, :activate,
:deleted, :suspend , :unsuspend, :purge, :toggle_role, :update
]
end

role :moderator do
has_permission_on [
:moderator_dashboard
], :to => [:manage]
end
end

privileges do
privilege :manage, :includes => [:create, :read, :update, :delete]
privilege :read, :includes => [:show]
privilege :create, :includes => :new
privilege :update, :includes => :edit
privilege :delete, :includes => :destroy
end