effective_roles 2.3.2 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/acts_as_role_restricted.rb +6 -6
- data/lib/effective_roles/version.rb +1 -1
- data/lib/effective_roles.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c69a70691f07ea3a230ae228c8565d7b19dbf6d0a763e525c54d2cbfb11232b2
|
4
|
+
data.tar.gz: f4824b2d42940c9b6dc77b43034072e039f542c0a6bb666cde104d7dcbd3ed73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8be49a02fcb6ce1e16a5700a3a5c4e3d8cc971391612427a466158b2ae3cf526bc99810207196fc014eaaaa18b7723165fe260716700020af3df4281882eac8
|
7
|
+
data.tar.gz: e850cf95ecb6e75d4b052d78368d65a354910c774cdeeba1be866c8cf60b65f9672f2bfba7572460dbeb94e94e5d20e7589c7563d4945454a40caea53b1a5ed9
|
@@ -98,8 +98,8 @@ module ActsAsRoleRestricted
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def add_role(role)
|
101
|
-
raise(
|
102
|
-
raise(
|
101
|
+
raise("expected role to be a symbol but got #{role || 'nil'}") unless role.kind_of?(Symbol)
|
102
|
+
raise("unknown role :#{role}") unless EffectiveRoles.roles_mask_for(role) > 0
|
103
103
|
|
104
104
|
assign_attributes(roles: roles | [role])
|
105
105
|
end
|
@@ -109,8 +109,8 @@ module ActsAsRoleRestricted
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def remove_role(role)
|
112
|
-
raise(
|
113
|
-
raise(
|
112
|
+
raise("expected role to be a symbol but got #{role || 'nil'}") unless role.kind_of?(Symbol)
|
113
|
+
raise("unknown role :#{role}") unless EffectiveRoles.roles_mask_for(role) > 0
|
114
114
|
|
115
115
|
assign_attributes(roles: roles - [role])
|
116
116
|
end
|
@@ -121,8 +121,8 @@ module ActsAsRoleRestricted
|
|
121
121
|
|
122
122
|
# if user.is? :admin
|
123
123
|
def is?(role)
|
124
|
-
raise(
|
125
|
-
raise(
|
124
|
+
raise("expected role to be a symbol but got #{role || 'nil'}") unless role.kind_of?(Symbol)
|
125
|
+
raise("unknown role :#{role}") unless EffectiveRoles.roles_mask_for(role) > 0
|
126
126
|
|
127
127
|
roles.include?(role)
|
128
128
|
end
|
data/lib/effective_roles.rb
CHANGED
@@ -59,7 +59,7 @@ module EffectiveRoles
|
|
59
59
|
next if disabled && skip_disabled
|
60
60
|
|
61
61
|
[
|
62
|
-
"#{role}<
|
62
|
+
"#{role}<small class='form-text text-muted'>#{role_description(role, resource)}</small>".html_safe,
|
63
63
|
role,
|
64
64
|
({:disabled => :disabled} if disabled)
|
65
65
|
]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_roles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|