本文整理了Java中org.nuxeo.ecm.core.api.security.ACL.setACEs()
方法的一些代码示例,展示了ACL.setACEs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ACL.setACEs()
方法的具体详情如下:
包路径:org.nuxeo.ecm.core.api.security.ACL
类名称:ACL
方法名:setACEs
[英]Sets the ACEs defined by this ACL.
[中]设置此ACL定义的ACE。
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-userworkspace-core
@Override
protected DocumentModel initCreateUserWorkspace(CoreSession unrestrictedSession, DocumentModel doc,
String username) {
ACP acp = new ACPImpl();
ACE grantEverything = new ACE(username, SecurityConstants.EVERYTHING, true);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { grantEverything });
acp.addACL(acl);
doc.setACP(acp, true);
Map<String, Serializable> properties = new HashMap<>();
properties.put("username", username);
notifyEvent(unrestrictedSession, doc, unrestrictedSession.getPrincipal(),
DocumentEventTypes.USER_WORKSPACE_CREATED, properties);
return doc;
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-userworkspace-core
@Override
protected DocumentModel initCreateUserWorkspacesRoot(CoreSession unrestrictedSession, DocumentModel doc) {
ACP acp = new ACPImpl();
ACE denyEverything = new ACE(SecurityConstants.EVERYONE, SecurityConstants.EVERYTHING, false);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { denyEverything });
acp.addACL(acl);
doc.setACP(acp, true);
return doc;
}
代码示例来源:origin: toutatice-services.dafpic/toutatice-dafpic-import-compatibility
acl.setACEs(acesList.toArray(new ACE[acesList.size()]));
acp.addACL(acl);
this.session.setACP(createDocument.getRef(), acp,
代码示例来源:origin: org.osivia.demo/demo-nx-custom
protected void setFoldersACL(DocumentModel doc, String userName)
throws ClientException {
ACP acp = new ACPImpl();
ACE grantMembersRead = new ACE(SecurityConstants.EVERYONE,
SecurityConstants.READ, true);
ACE grantEverything = new ACE(userName, SecurityConstants.EVERYTHING,
true);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { grantMembersRead, grantEverything });
acp.addACL(acl);
doc.setACP(acp, true);
}
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-comment
protected void setCommentPermissions(CoreSession session, DocumentModel documentModel) {
ACP acp = new ACPImpl();
ACE grantRead = new ACE(SecurityConstants.EVERYONE, SecurityConstants.READ, true);
ACE grantRemove = new ACE("members", SecurityConstants.REMOVE, true);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { grantRead, grantRemove });
acp.addACL(acl);
session.setACP(documentModel.getRef(), acp, true);
}
代码示例来源:origin: org.osivia.demo/proto-cns-nuxeo-custom
protected void setFoldersACL( DocumentModel doc, String userName) throws ClientException {
// UserService userService = Framework.getService(UserService.class);
// String defaultGroup = userService.getUserManager().getDefaultGroup();
ACP acp = new ACPImpl();
// ACE grantMembersRead = new ACE(defaultGroup, SecurityConstants.READ,
// true);
ACE grantMembersRead = new ACE(SecurityConstants.MEMBERS, SecurityConstants.READ,
true);
ACE grantEverything = new ACE(userName, SecurityConstants.EVERYTHING,
true);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { grantMembersRead, grantEverything });
acp.addACL(acl);
doc.setACP(acp, true);
}
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-comment
protected void setFolderPermissions(CoreSession session, DocumentModel documentModel) {
ACP acp = new ACPImpl();
ACE grantAddChildren = new ACE("members", SecurityConstants.ADD_CHILDREN, true);
ACE grantRemoveChildren = new ACE("members", SecurityConstants.REMOVE_CHILDREN, true);
ACE grantRemove = new ACE("members", SecurityConstants.REMOVE, true);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { grantAddChildren, grantRemoveChildren, grantRemove });
acp.addACL(acl);
session.setACP(documentModel.getRef(), acp, true);
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-userworkspace-core
/**
* @since 10.3
*/
protected DocumentModel initCreateFavorites(CoreSession session, DocumentModel favorites) {
ACP acp = new ACPImpl();
ACE denyEverything = new ACE(SecurityConstants.EVERYONE, SecurityConstants.EVERYTHING, false);
ACE allowEverything = new ACE(session.getPrincipal().getName(), SecurityConstants.EVERYTHING, true);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { allowEverything, denyEverything });
acp.addACL(acl);
favorites.setACP(acp, true);
return favorites;
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-userworkspace-core
/**
* @since 10.3
*/
protected DocumentModel initDefaultCollectionsRoot(final CoreSession session, DocumentModel collectionsRoot) {
ACP acp = new ACPImpl();
ACE denyEverything = new ACE(SecurityConstants.EVERYONE, SecurityConstants.EVERYTHING, false);
ACE allowEverything = new ACE(session.getPrincipal().getName(), SecurityConstants.EVERYTHING, true);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { allowEverything, denyEverything });
acp.addACL(acl);
collectionsRoot.setACP(acp, true);
return collectionsRoot;
}
代码示例来源:origin: org.nuxeo/acaren-nuxeo-userworkspace
protected static DocumentModel createUserWorkspaceDomain(
CoreSession unrestrictedSession, String domainName)
throws ClientException {
DocumentModel doc = unrestrictedSession.createDocumentModel("/",domainName, "Domain");
doc.setProperty("dublincore", "title",
domainName);
doc.setProperty("dublincore", "description", "");
doc = unrestrictedSession.createDocument(doc);
ACP acp = new ACPImpl();
ACE denyEverything = new ACE(SecurityConstants.EVERYONE,
SecurityConstants.EVERYTHING, false);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { denyEverything });
acp.addACL(acl);
doc.setACP(acp, true);
return doc;
}
代码示例来源:origin: org.nuxeo/acaren-nuxeo-userworkspace
protected static DocumentModel createUserWorkspace(
CoreSession unrestrictedSession, PathRef wsRef, String userName)
throws ClientException {
String parentPath = new Path(wsRef.toString()).removeLastSegments(1).toString();
String wsName = new Path(wsRef.toString()).lastSegment();
DocumentModel doc = unrestrictedSession.createDocumentModel(parentPath,
wsName,"UserWorkspace");
doc.setProperty("dublincore", "title", userName);
doc.setProperty("dublincore", "description", "");
doc = unrestrictedSession.createDocument(doc);
ACP acp = new ACPImpl();
ACE grantEverything = new ACE(userName, SecurityConstants.EVERYTHING,
true);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { grantEverything });
acp.addACL(acl);
doc.setACP(acp, true);
return doc;
}
代码示例来源:origin: org.nuxeo/acaren-nuxeo-userworkspace
protected static DocumentModel createUserWorkspacesRoot(
CoreSession unrestrictedSession, PathRef rootRef)
throws ClientException {
String parentPath = new Path(rootRef.toString()).removeLastSegments(1).toString();
String docName = new Path(rootRef.toString()).lastSegment();
DocumentModel doc = unrestrictedSession.createDocumentModel(parentPath,
docName,"UserWorkspacesRoot");
doc.setProperty("dublincore", "title",
docName);
doc.setProperty("dublincore", "description", "");
doc = unrestrictedSession.createDocument(doc);
ACP acp = new ACPImpl();
ACE denyEverything = new ACE(SecurityConstants.EVERYONE,
SecurityConstants.EVERYTHING, false);
ACL acl = new ACLImpl();
acl.setACEs(new ACE[] { denyEverything });
acp.addACL(acl);
doc.setACP(acp, true);
return doc;
}
内容来源于网络,如有侵权,请联系作者删除!