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.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RoleAuthorization
2
- VERSION = "0.4.5"
2
+ VERSION = "0.5.0"
3
3
  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.4.5
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-04-20 00:00:00 -04:00
13
+ date: 2011-06-01 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency