コード例 #1
0
ファイル: AppModule.java プロジェクト: CyrilleG/intranet
  public boolean isAffected(ModuleAction action) throws NotEmptyException {

    if (action == null) throw new NotEmptyException("action cannot be empty");

    for (ModuleAction item : moduleActions) if (item.equals(action)) return true;
    return false;
  }
コード例 #2
0
ファイル: AppModule.java プロジェクト: CyrilleG/intranet
  public void removeAction(ModuleAction action)
      throws AccessNotAllowedException, NotEmptyException {

    if (action == null) throw new NotEmptyException("action cannot be empty");

    if (Tools.hasRight("REMOVE_ACTION_FROM_MODULE")) {
      for (ModuleAction gp : moduleActions)
        if (gp.equals(action)) {
          gp.remove();
          break;
        }
    } else throw new AccessNotAllowedException("You can't remove action from module");
  }