Examples of allows()


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

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

        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.allows()

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

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

        assertFalse(impers.allows(buildSubject(otherP)));
    }

    public void testModifyOthersImpersonators() throws RepositoryException {
        Principal p = uMgr.getAuthorizable(uID).getPrincipal();
View Full Code Here

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

        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();

        assertFalse(adminImpersonation.grantImpersonation(adminPrincipal));
View Full Code Here

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

        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

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

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

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

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

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

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

            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.
            if (u != null) {
                u.remove();
                save(otherSession);
View Full Code Here

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

        // modify impersonation of another user
        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)));
View Full Code Here

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

        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);
            save(otherSession);
        } else {
            throw new NotExecutableException("Cannot execute test. OtherP can already impersonate UID-user.");
View Full Code Here

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

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

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

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

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

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

            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.
            if (u != null) {
                u.remove();
                save(otherSession);
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.