Package org.apache.jackrabbit.core.security.principal

Examples of org.apache.jackrabbit.core.security.principal.PrincipalImpl


                    "   <sv:property sv:name=\"jcr:uuid\" sv:type=\"String\"><sv:value>e358efa4-89f5-3062-b10d-d7316b65649e</sv:value></sv:property>" +
                    "   <sv:property sv:name=\"rep:password\" sv:type=\"String\"><sv:value>{sha1}8efd86fb78a56a5145ed7739dcb00c78581c5375</sv:value></sv:property>" +
                    "   <sv:property sv:name=\"rep:principalName\" sv:type=\"String\"><sv:value>t</sv:value></sv:property><sv:property sv:name=\"rep:impersonators\" sv:type=\"String\"><sv:value>" +principalName+ "</sv:value></sv:property>" +
                    "</sv:node>";
            Subject subj = new Subject();
            subj.getPrincipals().add(new PrincipalImpl(principalName));

            NodeImpl target = (NodeImpl) sImpl.getNode(umgr.getUsersPath());
            try {
                doImport(target, xml, UserImporter.ImportBehavior.ABORT);
                fail("UserImporter.ImportBehavior.ABORT -> importing invalid impersonators must throw.");
View Full Code Here


            try {
                String principalName = aceNode.getProperty(P_PRINCIPAL_NAME).getString();
                Principal princ = principalMgr.getPrincipal(principalName);
                if (princ == null) {
                    log.debug("Principal with name " + principalName + " unknown to PrincipalManager.");
                    princ = new PrincipalImpl(principalName);
                }

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

                    // should not get here
                }
            }
            if (princ == null) {
                log.warn("Principal "+ refName +" unknown to PrincipalManager.");
                princ = new PrincipalImpl(refName);
            }
            coll.add(princ);
        }
        return new PrincipalIteratorAdapter(coll);
    }
View Full Code Here

                    // should not get here
                }
            }
            if (princ == null) {
                log.warn("Principal "+ refName +" unknown to PrincipalManager.");
                princ = new PrincipalImpl(refName);
            }
            coll.add(princ);
        }
        return new PrincipalIteratorAdapter(coll);
    }
View Full Code Here

                        // should not get here.
                    }
                }
                if (princ == null) {
                    log.debug("Principal with name " + principalName + " unknown to PrincipalManager.");
                    princ = new PrincipalImpl(principalName);
                }

                Value[] privValues = aceNode.getProperty(AccessControlConstants.P_PRIVILEGES).getValues();
                Privilege[] privs = new Privilege[privValues.length];
                for (int i = 0; i < privValues.length; i++) {
View Full Code Here

                        // should not get here
                    }
                }
                if (princ == null) {
                    log.warn("Principal with name " + principalName + " unknown to PrincipalManager.");
                    princ = new PrincipalImpl(principalName);
                }

                Value[] privValues = aceNode.getProperty(AccessControlConstants.P_PRIVILEGES).getValues();
                Privilege[] privs = new Privilege[privValues.length];
                for (int i = 0; i < privValues.length; i++) {
View Full Code Here

        Principal principal = getPrincipal(acNode.getPath());
        if (principal == null) {
            // use fall back in order to be able to get/remove the policy
            String principalName = getPrincipalName(acNode.getPath());
            log.warn("Principal with name " + principalName + " unknown to PrincipalManager.");
            principal = new PrincipalImpl(principalName);
        }
        return new ACLTemplate(principal, acNode);
    }
View Full Code Here

        return false;
    }

    private static boolean initGroup(UserManager uMgr, String principalName) {
        boolean success;
        Principal prnc = new PrincipalImpl(principalName);
        try {
            Authorizable auth = uMgr.getAuthorizable(prnc);
            if (auth == null) {
                success = (uMgr.createGroup(prnc) != null);
            } else {
View Full Code Here

                String pName = SecurityConstants.ADMINISTRATORS_NAME;
                if (pMgr.hasPrincipal(pName)) {
                    administrators = pMgr.getPrincipal(pName);
                } else {
                    log.warn("Administrators principal group is missing.");
                    administrators = new PrincipalImpl(pName);
                }
                AccessControlPolicy[] acls = editor.editAccessControlPolicies(administrators);
                ACLTemplate acl = (ACLTemplate) acls[0];
                if (acl.isEmpty()) {
                    log.debug("... Privilege.ALL for administrators principal.");
View Full Code Here

     * @throws RepositoryException If an error occurs.
     */
    private static void createSystemUsers(UserManager userManager,
                                          String adminId,
                                          String anonymousId) throws RepositoryException {
        Principal pr = new PrincipalImpl(SecurityConstants.ADMINISTRATORS_NAME);
        Group admins = (Group) userManager.getAuthorizable(pr);
        if (admins == null) {
            admins = userManager.createGroup(new PrincipalImpl(SecurityConstants.ADMINISTRATORS_NAME));
            log.debug("...created administrators group with name '"+SecurityConstants.ADMINISTRATORS_NAME+"'");
        }

        if (adminId != null) {
            Authorizable admin = userManager.getAuthorizable(adminId);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.security.principal.PrincipalImpl

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.