parameters inside access control

10 views
Skip to first unread message

Edu Mariano

unread,
Aug 3, 2011, 2:53:00 PM8/3/11
to acl9-discuss
Hi, first of all sorry for posting in portuguese, kk

now in english

i has te following code:

access_control do
#--------------------------------Permissões liberadas para
administrador-----------------------------------
allow :Administrador
#----------------------------------------Permissões para
indicators----------------------------------------

@roles = Permission.find(:all,
:joins => :role,
:joins => :interface,
:conditions => {:interfaces => {:name =>
params[:interface] }})
@roles.map do |r|
allow r.role.name.to_sym, :to => [:edit] if r.read
allow r.role.name.to_sym, :to => [:new, :create, :live_search]
if r.include
allow r.role.name.to_sym, :to => [:edit, :update, :live_search]
if r.write
allow r.role.name.to_sym, :to => [:destroy] if r.exclude
end

#----------------------------------------------------------------------------------------------------------
end

wich is giving the following error:

undefined local variable or method `params' for
Acl9::Dsl::Generators::FilterLambda:0x4979430>

I would like to know if is possible to pass parameters inside access
control block, i have tried class variables, but it gives me
concurrency problems.

Thank in advance

Desde já agradeço
Reply all
Reply to author
Forward
0 new messages