Пример #1
0
  public void recalculatePermissionDefaults(Permission perm) {
    if (permissions.containsValue(perm)) {
      defaultPerms.get(true).remove(perm);
      defaultPerms.get(false).remove(perm);

      calculatePermissionDefault(perm);
    }
  }
Пример #2
0
  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);
  }