Package org.apache.chemistry.opencmis.commons.data

Examples of org.apache.chemistry.opencmis.commons.data.Acl


    }

    private String createDocument(String name, String folderId, String typeId, Map<String, Object> properties,
            VersioningState verState, ContentStream contentStream) {
        List<String> policies = null;
        Acl addACEs = null;
        Acl removeACEs = null;
        ExtensionsData extension = null;

        Properties props = createDocumentProperties(name, typeId, properties);

        String id = null;
View Full Code Here


        String objectId = getObjectId();
        return getBinding().getAclService().getAcl(getRepositoryId(), objectId, onlyBasicPermissions, null);
    }

    public Acl applyAcl(List<Ace> addAces, List<Ace> removeAces, AclPropagation aclPropagation) {
        Acl result = getSession().applyAcl(this, addAces, removeAces, aclPropagation);

        refresh();

        return result;
    }
View Full Code Here

    }

    public Acl createAcl(List<Ace> aces) {
        BindingsObjectFactory bof = getBindingsObjectFactory();

        Acl acl = bof.createAccessControlList(aces);

        return acl;
    }
View Full Code Here

        ChangeType changeType = null;
        GregorianCalendar changeTime = null;
        String objectId = null;
        Map<String, List<?>> properties = null;
        List<String> policyIds = null;
        Acl acl = null;

        if (objectData.getChangeEventInfo() != null) {
            changeType = objectData.getChangeEventInfo().getChangeType();
            changeTime = objectData.getChangeEventInfo().getChangeTime();
        }
View Full Code Here

    protected String createDocumentNoCatch(String name, String folderId, String typeId, VersioningState versioningState,
            boolean withContent) {
        ContentStream contentStream = null;
        List<String> policies = null;
        Acl addACEs = null;
        Acl removeACEs = null;
        ExtensionsData extension = null;

        Properties props = createDocumentProperties(name, typeId);

        if (withContent) {
View Full Code Here

            throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

            Acl acl = service.applyAcl(repositoryId, objectId, convert(addAces, null), convert(removeAces, null),
                    convert(AclPropagation.class, aclPropagation), convert(extension));

            if (acl == null) {
                return null;
            }

            CmisACLType result = new CmisACLType();
            result.setACL(convert(acl));
            result.setExact(acl.isExact());

            return result;
        } catch (Exception e) {
            throw convertException(e);
        } finally {
View Full Code Here

    public Acl applyAcl(String repositoryId, String objectId, Acl addAces, Acl removeAces,
            AclPropagation aclPropagation, ExtensionsData extension) {

        // fetch the current ACL
        Acl originalAces = getAcl(repositoryId, objectId, false, null);

        // if no changes required, just return the ACL
        if (!isAclMergeRequired(addAces, removeAces)) {
            return originalAces;
        }

        // merge ACLs
        Acl newACL = mergeAcls(originalAces, addAces, removeAces);

        // update ACL
        AtomAcl acl = updateAcl(repositoryId, objectId, newACL, aclPropagation);
        Acl result = convert(acl.getACL(), null);

        return result;
    }
View Full Code Here

            CmisExtensionType extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

            Acl acl = service.getAcl(repositoryId, objectId, onlyBasicPermissions, convert(extension));
            if (acl == null) {
                return null;
            }

            CmisACLType result = new CmisACLType();
            result.setACL(convert(acl));
            result.setExact(acl.isExact());

            return result;
        } catch (Exception e) {
            throw convertException(e);
        } finally {
View Full Code Here

                // create folder and document
                Folder testFolder = createTestFolder(session);
                Document doc = createDocument(session, testFolder, "acltest.txt", "ACL test");

                // check if there is an ACL
                Acl acl = doc.getAcl();

                f = createResult(FAILURE, "ACLs are supported but newly created document has no ACL!");
                addResult(assertNotNull(acl, null, f));

                // check basic permissions
                Acl basicAcl = session.getAcl(doc, true);

                f = createResult(FAILURE,
                        "ACLs are supported but repository does not return a basic ACL for the newly created document!");
                addResult(assertNotNull(basicAcl, null, f));

                if (basicAcl != null) {
                    addResult(checkACL(session, basicAcl, "Basic ACL"));

                    if (basicAcl.getAces() != null) {
                        for (Ace ace : basicAcl.getAces()) {
                            if (ace.getPermissions() != null) {
                                for (String permission : ace.getPermissions()) {
                                    if (!"cmis:read".equals(permission) && !"cmis:write".equals(permission)
                                            && !"cmis:all".equals(permission)) {
                                        addResult(createResult(FAILURE, "ACE contains a non-basic permission: "
View Full Code Here

    public static Acl convert(CmisACLType acl) {
        if (acl == null) {
            return null;
        }

        Acl result = convert(acl.getACL(), acl.isExact());

        // handle extensions
        convertExtension(acl, result);

        return result;
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.data.Acl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.