Again about if_attribute

0 views
Skip to first unread message

Houdini

unread,
Oct 3, 2009, 8:08:23 PM10/3/09
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

Houdini

unread,
Oct 4, 2009, 11:29:20 AM10/4/09
to declarative_authorization
All is Ok now.
My main error was my inadvertence
Reply all
Reply to author
Forward
0 new messages