Examples of grantImpersonation()


Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

            save(otherSession);

            Impersonation impers = u.getImpersonation();
            assertFalse(impers.allows(buildSubject(otherP)));

            assertTrue(impers.grantImpersonation(otherP));
            save(otherSession);

            assertTrue(impers.allows(buildSubject(otherP)));
        } finally {
            // impersonation get removed while removing the user u.
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

        u = (User) umgr.getAuthorizable(uID);
        Impersonation uImpl = u.getImpersonation();

        if (!uImpl.allows(buildSubject(otherP))) {
            // ... trying to modify 'impersonators of another user must succeed
            assertTrue(uImpl.grantImpersonation(otherP));
            save(otherSession);

            assertTrue(uImpl.allows(buildSubject(otherP)));

            uImpl.revokeImpersonation(otherP);
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

                        if (!imp.revokeImpersonation(princ)) {
                            handleFailure("Failed to revoke impersonation for " + princ.getName() + " on " + a);
                        }
                    }
                    for (Principal princ : toAdd) {
                        if (!imp.grantImpersonation(princ)) {
                            handleFailure("Failed to grant impersonation for " + princ.getName() + " on " + a);
                        }
                    }
                    // NOTE: no best effort handling so far. (TODO)
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

        User child = (User) umgr.getAuthorizable(getYetAnotherID());
        Impersonation impers = child.getImpersonation();
        assertFalse(impers.allows(buildSubject(selfPrinc)));
        try {
            assertFalse(impers.grantImpersonation(selfPrinc));
            save(uSession);
        } catch (AccessDeniedException e) {
            // ok.
        }
        assertFalse(impers.allows(buildSubject(selfPrinc)));
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

        User parent = (User) umgr.getAuthorizable(otherUID);
        impers = parent.getImpersonation();
        assertFalse(impers.allows(buildSubject(selfPrinc)));
        try {
            assertFalse(impers.grantImpersonation(selfPrinc));
            save(uSession);
        } catch (AccessDeniedException e) {
            // ok.
        }
        assertFalse(impers.allows(buildSubject(selfPrinc)));
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

                        if (!imp.revokeImpersonation(princ)) {
                            handleFailure("Failed to revoke impersonation for " + princ.getName() + " on " + a);
                        }
                    }
                    for (Principal princ : toAdd) {
                        if (!imp.grantImpersonation(princ)) {
                            handleFailure("Failed to grant impersonation for " + princ.getName() + " on " + a);
                        }
                    }
                    // NOTE: no best effort handling so far. (TODO)
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

            List<String> nonExisting = new ArrayList<String>();
            for (String principalName : toAdd) {
                Principal principal = (principals.containsKey(principalName)) ?
                        principals.get(principalName) :
                        new PrincipalImpl(principalName);
                if (!imp.grantImpersonation(principal)) {
                    handleFailure("Failed to grant impersonation for " + principalName + " on " + a);
                    if (importBehavior == ImportBehavior.BESTEFFORT &&
                            getPrincipalManager().getPrincipal(principalName) == null) {
                        log.info("ImportBehavior.BESTEFFORT: Remember non-existing impersonator for special processing.");
                        nonExisting.add(principalName);
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

                        if (!imp.revokeImpersonation(princ)) {
                            handleFailure("Failed to revoke impersonation for " + princ.getName() + " on " + a);
                        }
                    }
                    for (Principal princ : toAdd) {
                        if (!imp.grantImpersonation(princ)) {
                            handleFailure("Failed to grant impersonation for " + princ.getName() + " on " + a);
                        }
                    }
                    // NOTE: no best effort handling so far. (TODO)
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

            Principal p = getTestPrincipal();
            u = umgr.createUser(p.getName(), buildPassword(p));

            Impersonation impers = u.getImpersonation();
            assertFalse(impers.allows(buildSubject(otherP)));
            assertTrue(impers.grantImpersonation(otherP));
            assertTrue(impers.allows(buildSubject(otherP)));
        } finally {
            // impersonation get removed while removing the user u.
            if (u != null) {
                u.remove();
View Full Code Here

Examples of org.apache.jackrabbit.api.security.user.Impersonation.grantImpersonation()

        Principal otherP = umgr.getAuthorizable(otherUID).getPrincipal();

        if (!uImpl.allows(buildSubject(otherP))) {
            // ... trying to modify 'impersonators of 'uid' must not succeed.
            try {
                assertFalse(uImpl.grantImpersonation(otherP));
            } catch (AccessDeniedException e) {
                // success
            } finally {
                assertFalse(uImpl.allows(buildSubject(otherP)));
                uImpl.revokeImpersonation(otherP);
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.