Examples of ACP


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

    private void initializeSocialWorkspaceRights(SocialWorkspace socialWorkspace) {
        try {
            DocumentModel doc = socialWorkspace.getDocument();
            CoreSession session = doc.getCoreSession();
            ACP acp = doc.getACP();
            ACL acl = acp.getOrCreateACL(SOCIAL_WORKSPACE_ACL_NAME);
            addSocialWorkspaceACL(acl, socialWorkspace);
            doc.setACP(acp, true);
            doc.putContextData(ScopeType.REQUEST,
                    SocialWorkspaceListener.DO_NOT_PROCESS, true);
            doc = session.saveDocument(doc);
View Full Code Here

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

            CoreSession session = socialWorkspace.getDocument().getCoreSession();
            PathRef newsItemsRootPath = new PathRef(
                    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);
View Full Code Here

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

            SocialWorkspace socialWorkspace) throws ClientException {
        PathRef publicSectionRef = new PathRef(
                socialWorkspace.getPublicSectionPath());
        DocumentModel publicSection = session.getDocument(publicSectionRef);

        ACP acp = publicSection.getACP();
        ACL acl = acp.getOrCreateACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        acl.clear();
        addReadForDefaultGroup(acl);
        publicSection.setACP(acp, true);
        session.saveDocument(publicSection);
    }
View Full Code Here

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

    private void makePublicDashboardReadable(CoreSession session,
            SocialWorkspace socialWorkspace) throws ClientException {
        PathRef dashboardSpacesRootRef = new PathRef(
                socialWorkspace.getDashboardSpacesRootPath());
        DocumentModel dashboardSpacesRoot = session.getDocument(dashboardSpacesRootRef);
        ACP acp = dashboardSpacesRoot.getACP();
        ACL acl = acp.getOrCreateACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        acl.clear();
        addReadForDefaultGroup(acl);
        dashboardSpacesRoot.setACP(acp, true);
        session.saveDocument(dashboardSpacesRoot);

        PathRef privateDashboardSpaceRef = new PathRef(
                socialWorkspace.getPrivateDashboardSpacePath());
        DocumentModel privateDashboardSpace = session.getDocument(privateDashboardSpaceRef);
        acp = privateDashboardSpace.getACP();
        acl = acp.getOrCreateACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        addSocialWorkspaceACL(acl, socialWorkspace);
        privateDashboardSpace.setACP(acp, true);
        session.saveDocument(privateDashboardSpace);
    }
View Full Code Here

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

            SocialWorkspace socialWorkspace) throws ClientException {
        PathRef publicSectionRef = new PathRef(
                socialWorkspace.getPublicSectionPath());
        DocumentModel publicSection = session.getDocument(publicSectionRef);

        ACP acp = publicSection.getACP();
        acp.removeACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        publicSection.setACP(acp, true);
        session.saveDocument(publicSection);
    }
View Full Code Here

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

    private static void makePublicDashboardUnreadable(CoreSession session,
            SocialWorkspace socialWorkspace) throws ClientException {
        PathRef dashboardSpacesRootRef = new PathRef(
                socialWorkspace.getDashboardSpacesRootPath());
        DocumentModel dashboardSpacesRoot = session.getDocument(dashboardSpacesRootRef);
        ACP acp = dashboardSpacesRoot.getACP();
        acp.removeACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        dashboardSpacesRoot.setACP(acp, true);
        session.saveDocument(dashboardSpacesRoot);

        PathRef privateDashboardSpaceRef = new PathRef(
                socialWorkspace.getPrivateDashboardSpacePath());
        DocumentModel privateDashboardSpace = session.getDocument(privateDashboardSpaceRef);
        acp = privateDashboardSpace.getACP();
        acp.removeACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        privateDashboardSpace.setACP(acp, true);
        session.saveDocument(privateDashboardSpace);
    }
View Full Code Here

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

    }

    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
Copyright © 2018 www.massapi.com. 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.