Skip to content

Commit 90e9084

Browse files
committed
Создание ресурсов без глобальной роли
По мотивам #2
1 parent 6180daf commit 90e9084

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/ya_acl/builder.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def resources(allow, &block)
3535

3636
def resource(name, allow_roles = [], &block)
3737
raise ArgumentError, 'Options "allow_roles" must be Array' unless allow_roles.is_a? Array
38-
resource_allow_roles = allow_roles << @global_allow_role
38+
resource_allow_roles = allow_roles
39+
resource_allow_roles << @global_allow_role if @global_allow_role
3940
resource = Resource.new(name)
4041
acl.add_resource resource
4142
PrivilegeProxy.new(resource.name, resource_allow_roles, acl, block)

0 commit comments

Comments
 (0)