コード例 #1
0
  @Override
  public boolean hasLock() {
    if (!isCheckedOut()) {
      return false;
    }

    AllowableActions allowableActions = _document.getAllowableActions();

    Set<Action> allowableActionsSet = allowableActions.getAllowableActions();

    if (allowableActionsSet.contains(Action.CAN_CHECK_IN)) {
      return true;
    }

    List<CmisExtensionElement> cmisExtensionElements = allowableActions.getExtensions();

    for (CmisExtensionElement cmisExtensionElement : cmisExtensionElements) {

      String name = cmisExtensionElement.getName();

      if (name.equals("canCheckInSpecified")) {
        return GetterUtil.getBoolean(cmisExtensionElement.getValue());
      }
    }

    return false;
  }
コード例 #2
0
  public boolean hasLock() {
    if (!isCheckedOut()) {
      return false;
    }

    AllowableActions allowableActions = _document.getAllowableActions();

    Set<Action> allowableActionsSet = allowableActions.getAllowableActions();

    return allowableActionsSet.contains(Action.CAN_CHECK_IN);
  }
コード例 #3
0
 // //////////////////////////////////////////////////////////////////////////
 // Permission Check called from each CMIS method
 // //////////////////////////////////////////////////////////////////////////
 @Override
 public boolean checkPermission(CallContext callContext, Action action, ObjectData objectData) {
   AllowableActions _actions = objectData.getAllowableActions();
   if (_actions == null) {
     return false;
   } else {
     Set<Action> actions = _actions.getAllowableActions();
     if (CollectionUtils.isEmpty(actions)) {
       return false;
     } else {
       return actions.contains(action);
     }
   }
 }