cbac 0.6.9 → 0.6.10
Sign up to get free protection for your applications and to get access to all the features.
- data/cbac.gemspec +1 -1
- data/lib/cbac/cbac_pristine/pristine_permission.rb +3 -3
- metadata +1 -1
data/cbac.gemspec
CHANGED
@@ -133,12 +133,12 @@ module Cbac
|
|
133
133
|
raise ArgumentError, "Error: trying to revoke permission #{privilege_set_name} for #{pristine_role.name}, but this permission does not exist" unless cbac_permission_exists?
|
134
134
|
|
135
135
|
if pristine_role.role_type == PristineRole.ROLE_TYPES[:context]
|
136
|
-
permission = Cbac::Permission.
|
136
|
+
permission = Cbac::Permission.joins(:privilege_set).where("cbac_privilege_set.name = ?", privilege_set_name).where(context_role: pristine_role.name).first
|
137
137
|
else
|
138
|
-
permission = Cbac::Permission.
|
138
|
+
permission = Cbac::Permission.joins(:generic_role, :privilege_set).where("cbac_privilege_set.name = ?", privilege_set_name).where("cbac_generic_roles.name = ?", pristine_role.name).first
|
139
139
|
end
|
140
140
|
|
141
|
-
register_change if permission.destroy
|
141
|
+
register_change if Cbac::Permission.find(permission.id).destroy
|
142
142
|
end
|
143
143
|
|
144
144
|
# register this permission as a known permission
|