rule gets canceled out?

16 views
Skip to first unread message

David Morton

unread,
Jan 4, 2013, 4:21:24 PM1/4/13
to declarative_...@googlegroups.com

When I include both of the following roles into one role, it fails, but if I remove the _family_manager include, it works.

role :some_kind_of_admin
  includes :_family_manager
  includes :_family_reader
end

  role :_family_manager do
    has_permission_on :families, :to => :manage do
      if_permitted_to :manage, :children
    end
  end

  role :_family_reader do
    has_permission_on :families, :to => :read do
      if_permitted_to :read, :children
    end
  end


privileges do
  privilege :manage do
    includes :create, :read, :update
  end
  privilege :read do
    includes :index, :show, :search, :list
  end
...
end

Brad Langhorst

unread,
Jan 17, 2013, 11:32:55 AM1/17/13
to declarative_...@googlegroups.com
I should probably be circumspect about replying given my recent embarrassing history - but nobody else has replied - so maybe my suggestion is worth something.

I wonder if you want to try:

includes :_family_manager, :_family_reader

I don't know what happens with multiple include statements... is that a logical "and" or logical "or"

brad
Reply all
Reply to author
Forward
0 new messages