Skip to content

Commit

Permalink
Fix omnipotent roles for roles extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
stffn committed Mar 30, 2010
1 parent 0d3ac38 commit 9d3a0a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/declarative_authorization/authorization.rb
Expand Up @@ -154,7 +154,8 @@ def permit! (privilege, options = {})

user, roles, privileges = user_roles_privleges_from_options(privilege, options)

return true unless (roles & @omnipotent_roles).empty?
return true if roles.is_a?(Array) and not (roles & @omnipotent_roles).empty?

# find a authorization rule that matches for at least one of the roles and
# at least one of the given privileges
attr_validator = AttributeValidator.new(self, user, options[:object], privilege, options[:context])
Expand Down

0 comments on commit 9d3a0a8

Please sign in to comment.