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

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

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

ACL.clear介绍

暂无

代码示例

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

oldACL.clear();
  oldACL.addAll(acl);
} else {

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

@Override
public void setRules(String aclName, UserEntry[] userEntries, boolean overwrite) {
  ACL acl = getACL(aclName);
  if (acl == null) { // create the loca ACL
    acl = new ACLImpl(aclName);
    addACL(acl);
  } else if (overwrite) {
    // :XXX: Should not overwrite entries not given as parameters here.
    acl.clear();
  }
  for (UserEntry entry : userEntries) {
    String username = entry.getUserName();
    for (String permission : entry.getGrantedPermissions()) {
      acl.add(new ACE(username, permission, true));
    }
    for (String permission : entry.getDeniedPermissions()) {
      acl.add(new ACE(username, permission, false));
    }
  }
  cache.clear();
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-content-template-manager

protected void setAcl(List<ACEDescriptor> aces, DocumentRef ref) {
  if (aces != null && !aces.isEmpty()) {
    ACP acp = session.getACP(ref);
    ACL existingACL = acp.getOrCreateACL();
    // clean any existing ACL (should a merge strategy be adopted
    // instead?)
    existingACL.clear();
    // add the the ACL defined in the descriptor
    for (ACEDescriptor ace : aces) {
      existingACL.add(new ACE(ace.getPrincipal(), ace.getPermission(), ace.getGranted()));
    }
    // read the acl to invalidate the ACPImpl cache
    acp.addACL(existingACL);
    session.setACP(ref, acp, true);
  }
}

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

@Override
public void run() {
  ACP acp = session.getACP(ref);
  ACL acl = acp.getOrCreateACL(aclName);
  acl.clear();
  for (String validator : validators) {
    acl.add(new ACE(validator, SecurityConstants.READ));
    acl.add(new ACE(validator, SecurityConstants.WRITE));
  }
  // Give View permission to the user who submitted for publishing.
  acl.add(new ACE(principal.getName(), SecurityConstants.READ));
  // Allow administrators too.
  UserManager userManager = Framework.getService(UserManager.class);
  for (String group : userManager.getAdministratorsGroups()) {
    acl.add(new ACE(group, SecurityConstants.EVERYTHING));
  }
  // Deny everyone else.
  acl.add(ACE.BLOCK);
  session.setACP(ref, acp, true);
  session.save();
}

相关文章