role_authorization 0.4.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/role_authorization/user.rb +11 -0
- data/lib/role_authorization/version.rb +1 -1
- metadata +2 -2
@@ -135,6 +135,17 @@ module RoleAuthorization
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
+
def withdraw_from_scope(scope)
|
139
|
+
scope_key, scope_id = scope_with(scope)
|
140
|
+
return true if scope_key.nil? || self.serialized_roles[scope_key].nil?
|
141
|
+
|
142
|
+
if scope_id.nil?
|
143
|
+
self.serialized_roles.delete(scope_key)
|
144
|
+
else
|
145
|
+
self.serialized_roles[scope_key].delete(scope_id)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
138
149
|
def admin?
|
139
150
|
has_role?(:all, :global)
|
140
151
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: role_authorization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.5.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- John 'asceth' Long
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-01 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|