Search in sources :

Example 1 with PermissionDefinitionDataImpl

use of org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl in project copper-cms by PogeyanOSS.

the class RepositoryActor method createPermission.

private static PermissionDefinition createPermission(String permission, String description) {
    PermissionDefinitionDataImpl pd = new PermissionDefinitionDataImpl();
    pd.setId(permission);
    pd.setDescription(description);
    return pd;
}
Also used : PermissionDefinitionDataImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl)

Example 2 with PermissionDefinitionDataImpl

use of org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl in project alfresco-repository by Alfresco.

the class CMISConnector method getRepositoryPermissions.

private List<PermissionDefinition> getRepositoryPermissions() {
    ArrayList<PermissionDefinition> result = new ArrayList<PermissionDefinition>();
    Set<PermissionReference> all = permissionModelDao.getAllPermissions();
    for (PermissionReference pr : all) {
        result.add(createPermissionDefinition(pr));
    }
    PermissionReference allPermission = permissionModelDao.getPermissionReference(null, PermissionService.ALL_PERMISSIONS);
    result.add(createPermissionDefinition(allPermission));
    PermissionDefinitionDataImpl cmisPermission;
    cmisPermission = new PermissionDefinitionDataImpl();
    cmisPermission.setId(BasicPermissions.READ);
    cmisPermission.setDescription("CMIS Read");
    result.add(cmisPermission);
    cmisPermission = new PermissionDefinitionDataImpl();
    cmisPermission.setId(BasicPermissions.WRITE);
    cmisPermission.setDescription("CMIS Write");
    result.add(cmisPermission);
    cmisPermission = new PermissionDefinitionDataImpl();
    cmisPermission.setId(BasicPermissions.ALL);
    cmisPermission.setDescription("CMIS All");
    result.add(cmisPermission);
    return result;
}
Also used : PermissionDefinition(org.apache.chemistry.opencmis.commons.definitions.PermissionDefinition) PermissionReference(org.alfresco.repo.security.permissions.PermissionReference) ArrayList(java.util.ArrayList) PermissionDefinitionDataImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl)

Example 3 with PermissionDefinitionDataImpl

use of org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl in project alfresco-repository by Alfresco.

the class CMISConnector method createPermissionDefinition.

private PermissionDefinition createPermissionDefinition(PermissionReference pr) {
    PermissionDefinitionDataImpl permission = new PermissionDefinitionDataImpl();
    permission.setId(pr.getQName().toString() + "." + pr.getName());
    permission.setDescription(permission.getId());
    return permission;
}
Also used : PermissionDefinitionDataImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl)

Example 4 with PermissionDefinitionDataImpl

use of org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl in project iaf by ibissource.

the class CmisUtils method xml2permissionDefinitionList.

private static List<PermissionDefinition> xml2permissionDefinitionList(Element cmisResult) {
    List<PermissionDefinition> permissionsList = new ArrayList<PermissionDefinition>();
    Element permissionsXml = XmlUtils.getFirstChildTag(cmisResult, "permissions");
    for (Node node : XmlUtils.getChildTags(permissionsXml, "permission")) {
        Element element = (Element) node;
        PermissionDefinitionDataImpl permissionDefinition = new PermissionDefinitionDataImpl();
        permissionDefinition.setId(element.getAttribute("id"));
        permissionDefinition.setDescription(element.getAttribute("description"));
        permissionsList.add(permissionDefinition);
    }
    return permissionsList;
}
Also used : PermissionDefinition(org.apache.chemistry.opencmis.commons.definitions.PermissionDefinition) Element(org.w3c.dom.Element) Node(org.w3c.dom.Node) ArrayList(java.util.ArrayList) PermissionDefinitionDataImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl)

Example 5 with PermissionDefinitionDataImpl

use of org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl in project copper-cms by PogeyanOSS.

the class CopperCmsRepository method createPermission.

private static PermissionDefinition createPermission(String permission, String description) {
    PermissionDefinitionDataImpl pd = new PermissionDefinitionDataImpl();
    pd.setId(permission);
    pd.setDescription(description);
    return pd;
}
Also used : PermissionDefinitionDataImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl)

Aggregations

PermissionDefinitionDataImpl (org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl)5 ArrayList (java.util.ArrayList)2 PermissionDefinition (org.apache.chemistry.opencmis.commons.definitions.PermissionDefinition)2 PermissionReference (org.alfresco.repo.security.permissions.PermissionReference)1 Element (org.w3c.dom.Element)1 Node (org.w3c.dom.Node)1