本文整理了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
暂无
代码示例来源: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();
}
内容来源于网络,如有侵权,请联系作者删除!