lib/cbac/cbac_pristine/pristine.rb in cbac-0.5.1 vs lib/cbac/cbac_pristine/pristine.rb in cbac-0.5.2

- old
+ new

@@ -84,10 +84,12 @@ known_permissions.each { |p| p.destroy } end def delete_generic_permissions permissions = Cbac::Permission.find(:all, :conditions => {:context_role => nil}) - (permissions.select { |perm| perm.generic_role.name != "administrators" }).each { |p| p.destroy } + # for backwards compatibility, generic_role name was administrators instead of administrator + # SMELL: administrator role *only* identified by name + (permissions.select { |perm| perm.generic_role.name != "administrator" and perm.generic_role.name != "administrators" }).each { |p| p.destroy } end def delete_non_generic_staged_permissions PristinePermission.delete_non_generic_permissions end \ No newline at end of file