Is there a "false" scope?

11 views
Skip to first unread message

David Morton

unread,
May 13, 2013, 11:39:55 AM5/13/13
to declarative_...@googlegroups.com
I'm wondering if there is a way to create a rule the will always return an empty result set... I am doing a search like:

    @notes = Note.with_permission_to(:read)

But one user role type will never be able to read notes.   If I don't specify a rule for them, though, it throws an error, where I'd like to just have an empty result set.

For now, my workaround is to make a condition that won't happen:

    has_permission_on :notes, :to => [:read] do
      if_attribute :title => is{"This User is not allowed to read notes."}
    end

Reply all
Reply to author
Forward
0 new messages