public void recalculatePermissionDefaults(Permission perm) { if (permissions.containsValue(perm)) { defaultPerms.get(true).remove(perm); defaultPerms.get(false).remove(perm); calculatePermissionDefault(perm); } }
public void addPermission(Permission perm) { String name = perm.getName().toLowerCase(); if (permissions.containsKey(name)) { throw new IllegalArgumentException("The permission " + name + " is already defined!"); } permissions.put(name, perm); calculatePermissionDefault(perm); }