Skip to content

Commit

Permalink
allow to manually make role query strict
Browse files Browse the repository at this point in the history
  • Loading branch information
doits committed Jun 15, 2021
1 parent fbbb9f2 commit f9d4e29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rolify/finders.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Rolify
module Finders
def with_role(role_name, resource = nil)
strict = self.strict_rolify and resource and resource != :any
def with_role(role_name, resource = nil, strict = nil)
strict = self.strict_rolify and resource and resource != :any if strict.nil?
self.adapter.scope(
self,
{ :name => role_name, :resource => resource },
Expand Down Expand Up @@ -46,4 +46,4 @@ def parse_args(args, users, &block)
block.call(users_to_add)
end
end
end
end

0 comments on commit f9d4e29

Please sign in to comment.