stffn/declarative_authorization — Issue #119: Cant login to admin section
Author: swistaczek
Created: 2011-11-29 20:14:07+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

Admin base controller contains:
class Admin::BaseController < ApplicationController
filter_access_to :all