org.nuxeo.ecm.core.api.security.ACL.contains()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中org.nuxeo.ecm.core.api.security.ACL.contains()方法的一些代码示例,展示了ACL.contains()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ACL.contains()方法的具体详情如下:
包路径:org.nuxeo.ecm.core.api.security.ACL
类名称:ACL
方法名:contains

ACL.contains介绍

暂无

代码示例

代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-automation

/**
 * Blocks inheritance and set default rule.
 * 
 * @param session
 * @param document
 * @return acl
 */
protected ACL blockLocalACLIfNecessary(CoreSession session, DocumentModel document, ACL localAcl) {
  // Block ACL
  ACE blockInhACe = ACEsOperationHelper.getBlockInheritanceACe();
  if (!localAcl.contains(blockInhACe)) {
    // Add default rule
    ACL defaultLocalACL = ACEsOperationHelper.buildDefaultLocalACL(session, document);
    for(ACE ace : defaultLocalACL){
      if(!localAcl.contains(ace)){
        localAcl.add(ace);
      }
    }
    // Blocks
    localAcl.add(blockInhACe);
  }
  return localAcl;
}

代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-automation

/**
   * Restore inheritance.
   * 
   * @param session
   * @param document
   * @return acp
   */
  protected ACP restoreInheritanceIfNecessary(CoreSession session, DocumentModel document, ACL localAcl) {
    // ACP
    ACP acp = document.getACP();

    // Remove default rule
    ACL defaultLocalACL = ACEsOperationHelper.buildDefaultLocalACL(session, document);
    if (localAcl.containsAll(defaultLocalACL)) {
      localAcl.removeAll(defaultLocalACL);
    }

    // Remove block to restore inheritance
    ACE blockInACe = ACEsOperationHelper.getBlockInheritanceACe();
    if (localAcl.contains(blockInACe)) {
      localAcl.remove(blockInACe);
    }

    // To clear cache
    acp.addACL(localAcl);

    return acp;
  }
//

代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-automation

if (acl.contains(ace)) {
  acl.remove(ace);

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-task-core

if (!acl.contains(ace)) {
  acl.add(ace);

代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-automation

/**
 * Add ACEs on ACL.
 * 
 * @param acl
 * @param aces
 * @return modifed ACL
 */
@Override
protected ACL modifyACEs(ACL acl, List<ACE> aces) {
  // Add:
  // If inheritance id blocked, add before block
  ACE blockInhACe = ACEsOperationHelper.getBlockInheritanceACe();
  int blockInhPos = acl.indexOf(blockInhACe);
  for (ACE aceToAdd : aces) {
    if (!acl.contains(aceToAdd)) {
      if (blockInhPos != -1) {
        acl.add(blockInhPos, aceToAdd);
      } else {
        acl.add(aceToAdd);
      }
    }
  }
  return acl;
}

代码示例来源:origin: org.nuxeo.ecm.routing/nuxeo-routing-core

ACL routeACL = acp.getOrCreateACL(DocumentRoutingConstants.ROUTE_TASK_LOCAL_ACL);
ACE ace = new ACE(userName, SecurityConstants.READ_WRITE, true);
if (!routeACL.contains(ace)) {
  routeACL.add(ace);

代码示例来源:origin: toutatice-services.carto-nat/toutatice-carto-nat-ecm

acl.add(publicAce);
  acp.addACL(acl);
} else if (!acl.contains(publicAce)) {
  acl.add(publicAce);

相关文章