views:

22

answers:

0

And again a decl_auth problem

I want to achieve, that only active Users are allowed to view (:show) bookings

model code

User 
  has_many :events
  has_many :bookings

Event
  belongs_to :user
  has_many :bookings

Booking 
  belongs_to :event
  belongs_to :user


# user.active => true

in the authorization file

has_permission_on [:bookings], :to => [:show] do
    if_attribute :event =>  {:user => { :active => is {true} }}  
 end

Grmph...stuff doesn't work. What can I do? please help