Examples of revokeImpersonation()


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

        assertFalse(impers.grantImpersonation(user2Principal));
        superuser.save();

        assertTrue(impers.allows(subject));

        assertTrue(impers.revokeImpersonation(user2Principal));
        assertFalse(impers.revokeImpersonation(user2Principal));
        superuser.save();

        assertFalse(impers.allows(subject));
    }
View Full Code Here

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

        superuser.save();

        assertTrue(impers.allows(subject));

        assertTrue(impers.revokeImpersonation(user2Principal));
        assertFalse(impers.revokeImpersonation(user2Principal));
        superuser.save();

        assertFalse(impers.allows(subject));
    }
View Full Code Here

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

        // admin cannot be add/remove to set of impersonators of 'u' but is
        // always allowed to impersonate that user.
        Impersonation impersonation = user.getImpersonation();

        assertFalse(impersonation.grantImpersonation(adminPrincipal));
        assertFalse(impersonation.revokeImpersonation(adminPrincipal));
        assertTrue(impersonation.allows(buildSubject(adminPrincipal)));

        // same if the impersonation object of the admin itself is used.
        Impersonation adminImpersonation = ((User) admin).getImpersonation();
View Full Code Here

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

        // same if the impersonation object of the admin itself is used.
        Impersonation adminImpersonation = ((User) admin).getImpersonation();

        assertFalse(adminImpersonation.grantImpersonation(adminPrincipal));
        assertFalse(adminImpersonation.revokeImpersonation(adminPrincipal));
        assertTrue(impersonation.allows(buildSubject(adminPrincipal)));
    }
}
View Full Code Here

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

                        } // else: no need to revoke impersonation for the given principal.
                    }

                    // 2. adjust set of impersonators
                    for (Principal princ : toRemove.values()) {
                        if (!imp.revokeImpersonation(princ)) {
                            handleFailure("Failed to revoke impersonation for " + princ.getName() + " on " + a);
                        }
                    }
                    for (Principal princ : toAdd) {
                        if (!imp.grantImpersonation(princ)) {
View Full Code Here

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

                        } // else: no need to revoke impersonation for the given principal.
                    }

                    // 2. adjust set of impersonators
                    for (Principal princ : toRemove.values()) {
                        if (!imp.revokeImpersonation(princ)) {
                            handleFailure("Failed to revoke impersonation for " + princ.getName() + " on " + a);
                        }
                    }
                    for (Principal princ : toAdd) {
                        if (!imp.grantImpersonation(princ)) {
View Full Code Here

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

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

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

        assertTrue(impers.revokeImpersonation(otherP));
        save(uSession);

        assertFalse(impers.allows(buildSubject(otherP)));
    }
View Full Code Here

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

        // always allowed to impersonate that user.
        User u = (User) userMgr.getAuthorizable(uID);
        Impersonation impersonation = u.getImpersonation();

        assertFalse(impersonation.grantImpersonation(adminPrincipal));
        assertFalse(impersonation.revokeImpersonation(adminPrincipal));
        assertTrue(impersonation.allows(buildSubject(adminPrincipal)));

        // same if the impersonation object of the admin itself is used.
        Impersonation adminImpersonation = ((User) a).getImpersonation();
View Full Code Here

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

        // same if the impersonation object of the admin itself is used.
        Impersonation adminImpersonation = ((User) a).getImpersonation();

        assertFalse(adminImpersonation.grantImpersonation(adminPrincipal));
        assertFalse(adminImpersonation.revokeImpersonation(adminPrincipal));
        assertTrue(impersonation.allows(buildSubject(adminPrincipal)));
    }

    public void testSystemPrincipalAsImpersonator() throws RepositoryException {
        Principal systemPrincipal = new SystemPrincipal();
View Full Code Here

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

        // should it be allowed to impersonate a given user...
        User u = (User) userMgr.getAuthorizable(uID);
        Impersonation impersonation = u.getImpersonation();

        assertFalse(impersonation.grantImpersonation(systemPrincipal));
        assertFalse(impersonation.revokeImpersonation(systemPrincipal));
        assertFalse(impersonation.allows(buildSubject(systemPrincipal)));
    }
}
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.