コード例 #1
0
 @Override
 public void removeCapability(CapabilityVO capabilityToRemove) throws CapabilityManagerException {
   try {
     userSecurityProfileManager.removeAllAssignedUserCapability(capabilityToRemove);
     capabilityDAO.delete(capabilityToRemove.getId());
   } catch (Exception e) {
     throw new CapabilityManagerException(e);
   }
 }
コード例 #2
0
 @Override
 public void addActionsToCapability(List<ActionVO> actions, CapabilityVO capabilityVO)
     throws CapabilityManagerException {
   try {
     Capability capability = capabilityDAO.findData(capabilityVO.getId());
     List<CapabilityAction> actionsToAdd = new ArrayList<CapabilityAction>();
     Action action;
     CapabilityAction capabilityAction;
     for (ActionVO actionVO : actions) {
       action = SecurityEntityValueObjectConverter.toAction(actionVO);
       capabilityAction = new CapabilityAction();
       capabilityAction.setAction(action);
       capabilityAction.setCapability(capability);
       actionsToAdd.add(capabilityAction);
     }
     capability.getActions().addAll(actionsToAdd);
     capabilityDAO.update(capability);
   } catch (Exception e) {
     throw new CapabilityManagerException(e);
   }
 }