Houdini
unread,Oct 3, 2009, 8:08:23 PM10/3/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to declarative_authorization
Read last posts, but still do not understand why access is forbidden
ApplicationController:
before_filter :set_things
protected
def set_things
Authorization.current_user = current_user
......
end
Controller
class ClientInterface::ClientsController < ApplicationController
before_filter :load_client
filter_access_to :all, :attribute_check => true
layout 'client'
def show
date_for_date_chooser
end
protected
def load_client
@client = Consumer.find params[:id], :include => :wallets
end
end
Rules:
role :client do
has_permission_on [:client_access], :to => :read do
if_attribute :id => is {current_user.client_id}
end
end
User belongs_to client and client has_one user. Can not get access to
ClientsController.
Thanks in advance