Skip to content

Commit

Permalink
Создание ресурсов без глобальной роли
Browse files Browse the repository at this point in the history
По мотивам #2
  • Loading branch information
numbata committed Jan 21, 2016
1 parent 6180daf commit 90e9084
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ya_acl/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def resources(allow, &block)

def resource(name, allow_roles = [], &block)
raise ArgumentError, 'Options "allow_roles" must be Array' unless allow_roles.is_a? Array
resource_allow_roles = allow_roles << @global_allow_role
resource_allow_roles = allow_roles
resource_allow_roles << @global_allow_role if @global_allow_role
resource = Resource.new(name)
acl.add_resource resource
PrivilegeProxy.new(resource.name, resource_allow_roles, acl, block)
Expand Down

0 comments on commit 90e9084

Please sign in to comment.