Package org.apache.jackrabbit.core.security.authorization

Examples of org.apache.jackrabbit.core.security.authorization.PrivilegeManagerImpl$PrivilegeImpl


        this.state = new SessionState(this);
        this.valueFactory =
            new ValueFactoryImpl(session, repositoryContext.getDataStore());
        this.itemValidator = new ItemValidator(this);
        this.nodeTypeManager = new NodeTypeManagerImpl(this);
        this.privilegeManager = new PrivilegeManagerImpl(repositoryContext.getPrivilegeRegistry(), session);
        this.workspace = new WorkspaceImpl(this, workspaceConfig);
    }
View Full Code Here


            int events = Event.PROPERTY_CHANGED | Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED;
            observationMgr.addEventListener(this, events, groupsPath, true, null, null, false);
        }

        private PrivilegeBits getPrivilegeBits(String... privNames) throws RepositoryException {
            PrivilegeManagerImpl impl = getPrivilegeManagerImpl();
            Privilege[] privs = new Privilege[privNames.length];
            for (int i = 0; i < privNames.length; i++) {
                privs[i] = impl.getPrivilege(privNames[i]);
            }
            return impl.getBits(privs);
        }
View Full Code Here

        this.state = new SessionState(this);
        this.valueFactory =
            new ValueFactoryImpl(session, repositoryContext.getDataStore());
        this.itemValidator = new ItemValidator(this);
        this.nodeTypeManager = new NodeTypeManagerImpl(this);
        this.privilegeManager = new PrivilegeManagerImpl(repositoryContext.getPrivilegeRegistry(), session);
        this.nsRegistry = new PermissionAwareNamespaceRegistry();
        this.workspace = new WorkspaceImpl(this, workspaceConfig);
    }
View Full Code Here

            int events = Event.PROPERTY_CHANGED | Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED;
            observationMgr.addEventListener(this, events, groupsPath, true, null, null, false);
        }

        private PrivilegeBits getPrivilegeBits(String... privNames) throws RepositoryException {
            PrivilegeManagerImpl impl = getPrivilegeManagerImpl();
            Name[] names = new Name[privNames.length];
            for (int i = 0; i < privNames.length; i++) {
                names[i] = session.getQName(privNames[i]);
            }
            return impl.getBits(names);
        }
View Full Code Here

        }

        @Override
        protected Result buildRepositoryResult() throws RepositoryException {
            log.warn("TODO: JCR-2774 - Repository level permissions.");
            PrivilegeManagerImpl pm = getPrivilegeManagerImpl();
            return new Result(Permission.NONE, Permission.NONE, PrivilegeBits.EMPTY, PrivilegeBits.EMPTY);       
        }
View Full Code Here

        if (aclNode == null || !NT_REP_ACL.equals(aclNode.getPrimaryNodeTypeName())) {
            throw new IllegalArgumentException("Node must be of type 'rep:ACL'");
        }
        SessionImpl sImpl = (SessionImpl) aclNode.getSession();
        PrincipalManager principalMgr = sImpl.getPrincipalManager();
        PrivilegeManagerImpl privilegeMgr = (PrivilegeManagerImpl) ((JackrabbitWorkspace) sImpl.getWorkspace()).getPrivilegeManager();

        NodeId nodeId = aclNode.getParentId();

        List<Entry> entries = new ArrayList<Entry>();
        // load the entries:
        NodeIterator itr = aclNode.getNodes();
        while (itr.hasNext()) {
            NodeImpl aceNode = (NodeImpl) itr.nextNode();
            try {
                String principalName = aceNode.getProperty(P_PRINCIPAL_NAME).getString();
                boolean isGroupEntry = false;
                Principal princ = principalMgr.getPrincipal(principalName);
                if (princ != null) {
                    isGroupEntry = (princ instanceof Group);
                }

                InternalValue[] privValues = aceNode.getProperty(P_PRIVILEGES).internalGetValues();
                Name[] privNames = new Name[privValues.length];
                for (int i = 0; i < privValues.length; i++) {
                    privNames[i] = privValues[i].getName();
                }

                Value globValue = null;
                if (aceNode.hasProperty(P_GLOB)) {
                    globValue = aceNode.getProperty(P_GLOB).getValue();
                }

                boolean isAllow = NT_REP_GRANT_ACE.equals(aceNode.getPrimaryNodeTypeName());
                Entry ace = new Entry(nodeId, principalName, isGroupEntry, privilegeMgr.getBits(privNames), isAllow, path, globValue);
                entries.add(ace);
            } catch (RepositoryException e) {
                log.debug("Failed to build ACE from content. {}", e.getMessage());
            }
        }
View Full Code Here

        }

        @Override
        protected Result buildRepositoryResult() throws RepositoryException {
            log.warn("TODO: JCR-2774 - Repository level permissions.");
            PrivilegeManagerImpl pm = getPrivilegeManagerImpl();
            return new Result(Permission.NONE, Permission.NONE, PrivilegeBits.EMPTY, PrivilegeBits.EMPTY);       
        }
View Full Code Here

            int events = Event.PROPERTY_CHANGED | Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED;
            observationMgr.addEventListener(this, events, groupsPath, true, null, null, false);
        }

        private PrivilegeBits getPrivilegeBits(String... privNames) throws RepositoryException {
            PrivilegeManagerImpl impl = getPrivilegeManagerImpl();
            Name[] names = new Name[privNames.length];
            for (int i = 0; i < privNames.length; i++) {
                names[i] = session.getQName(privNames[i]);
            }
            return impl.getBits(names);
        }
View Full Code Here

        this.state = new SessionState(this);
        this.valueFactory =
            new ValueFactoryImpl(session, repositoryContext.getDataStore());
        this.itemValidator = new ItemValidator(this);
        this.nodeTypeManager = new NodeTypeManagerImpl(this);
        this.privilegeManager = new PrivilegeManagerImpl(repositoryContext.getPrivilegeRegistry(), session);
        this.nsRegistry = new PermissionAwareNamespaceRegistry();
        this.workspace = new WorkspaceImpl(this, workspaceConfig);
    }
View Full Code Here

            int events = Event.PROPERTY_CHANGED | Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED;
            observationMgr.addEventListener(this, events, groupsPath, true, null, null, false);
        }

        private PrivilegeBits getPrivilegeBits(String... privNames) throws RepositoryException {
            PrivilegeManagerImpl impl = getPrivilegeManagerImpl();
            Name[] names = new Name[privNames.length];
            for (int i = 0; i < privNames.length; i++) {
                names[i] = session.getQName(privNames[i]);
            }
            return impl.getBits(names);
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.security.authorization.PrivilegeManagerImpl$PrivilegeImpl

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.