Package org.nuxeo.ecm.core.api.security

Examples of org.nuxeo.ecm.core.api.security.ACE


        }
    }

    private void addSocialWorkspaceACL(ACL acl, SocialWorkspace socialWorkspace) {
        addEverythingForAdministratorsACE(acl);
        acl.add(new ACE(socialWorkspace.getAdministratorsGroupName(),
                SecurityConstants.EVERYTHING, true));
        acl.add(new ACE(socialWorkspace.getMembersGroupName(),
                SecurityConstants.READ_WRITE, true));
        acl.add(new ACE(EVERYONE, SecurityConstants.EVERYTHING, false));
    }
View Full Code Here


        acl.add(new ACE(EVERYONE, SecurityConstants.EVERYTHING, false));
    }

    private void addEverythingForAdministratorsACE(ACL acl) {
        for (String adminGroup : getUserManager().getAdministratorsGroups()) {
            acl.add(new ACE(adminGroup, EVERYTHING, true));
        }
    }
View Full Code Here

                    socialWorkspace.getNewsItemsRootPath());
            DocumentModel newsItemsRoot = session.getDocument(newsItemsRootPath);

            ACP acp = newsItemsRoot.getACP();
            ACL acl = acp.getOrCreateACL(NEWS_ITEMS_ROOT_ACL_NAME);
            acl.add(new ACE(socialWorkspace.getAdministratorsGroupName(),
                    EVERYTHING, true));
            acl.add(new ACE(socialWorkspace.getMembersGroupName(), READ));
            acl.add(ACE.BLOCK);
            newsItemsRoot.setACP(acp, true);
            session.saveDocument(newsItemsRoot);
        } catch (ClientException e) {
            throw new ClientRuntimeException(e);
View Full Code Here

    }

    private void addReadForDefaultGroup(ACL acl) {
        String defaultGroup = getUserManager().getDefaultGroup();
        defaultGroup = defaultGroup == null ? EVERYONE : defaultGroup;
        acl.add(new ACE(defaultGroup, READ, true));
    }
View Full Code Here

        createSocialWorkspace("marketing", true);
        createSocialWorkspace("sales", false);

        session.getRootDocument().getACP().getOrCreateACL().add(
                new ACE("John", "READ", true));
        session.setACP(session.getRootDocument().getRef(),
                session.getRootDocument().getACP(), true);
        }
    }
View Full Code Here

    protected void createDocumentsWithBender() throws ClientException {
        DocumentModel workspacesDocument = session.getDocument(new PathRef(
                "/default-domain/workspaces"));
        ACP acp = workspacesDocument.getACP();
        ACL acl = acp.getOrCreateACL();
        acl.add(new ACE("Bender", EVERYTHING, true));
        acl.add(new ACE("Leela", READ, true));
        workspacesDocument.setACP(acp, true);
        session.save();
        session.save();

        try (CoreSession newSession = openSessionAs("Bender")) {
            DocumentModel doc = newSession.createDocumentModel(
                    workspacesDocument.getPathAsString(), "file1", "File");
            doc = newSession.createDocument(doc);
            acp = doc.getACP();
            acl = acp.getOrCreateACL();
            acl.add(new ACE("Leela", READ, true));
            doc.setACP(acp, true);
            newSession.save();
            newSession.save();

            doc = newSession.createDocumentModel(
                    workspacesDocument.getPathAsString(), "file2", "File");
            doc = newSession.createDocument(doc);
            acp = doc.getACP();
            acl = acp.getOrCreateACL();
            acl.add(new ACE("Leela", READ, true));
            doc.setACP(acp, true);
            newSession.save();
            newSession.save();

            doc = newSession.createDocumentModel(
                    workspacesDocument.getPathAsString(), "file-without-right",
                    "File");
            doc = newSession.createDocument(doc);
            acp = doc.getACP();
            acl = acp.getOrCreateACL();
            acl.add(new ACE(SecurityConstants.ADMINISTRATOR, READ));
            acl.add(ACE.BLOCK);
            doc.setACP(acp, true);
            newSession.save();
            newSession.save();
View Full Code Here

TOP

Related Classes of org.nuxeo.ecm.core.api.security.ACE

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.