Package org.nxplanner.security.auth

Examples of org.nxplanner.security.auth.Authorizer


        firstWritableIteration.setStartDate(new Date(DAY));
        Iteration secondNonWritableIteration = newIteration(project2);
       
        commitCloseAndOpenSession();

        Authorizer authorizer = new AuthorizerImpl();
        IterationRepository dao = new IterationRepository(session, authorizer, person.getId());
        List list = dao.fetchEditableIterations();

        ArrayAssert.assertEquals("iterations returned", new Iteration[] {firstWritableIteration, secondWritableIteration}, list.toArray());
    }
View Full Code Here


        expectedStories[1] = newUserStory(firstWritableIteration);
        expectedStories[3] = newUserStory(secondWritableIteration);

        commitCloseAndOpenSession();

        Authorizer authorizer = new AuthorizerImpl();
        UserStoryRepository dao = new UserStoryRepository(session, authorizer, person.getId());
        List list = dao.fetchEditableStories();

        ArrayAssert.assertEquals("stories returned", expectedStories, list.toArray());
    }
View Full Code Here

        ThreadSession.set(session);

        boolean result = false;

        // exact match
        Authorizer authorizer = SystemAuthorizer.get();
        result = authorizer.
                hasPermission(projectId, personId, "system.project", 1, "testpermission");
        assertTrue("wrong result", result);

        // no match
        result = authorizer.
                hasPermission(projectId, personId, "system.project", 10, "testpermission");
        assertFalse("wrong result", result);

        // resource type wildcard, resourceId wildcard, permission name wildcard
        // viewer role
        result = authorizer.
                hasPermission(projectId, personId, "system.project.iteration.story", 10, "read.test");
        assertTrue("wrong result", result);

        // resource type wildcard, resourceId exact match, permission name wildcard
        // editor role
        result = authorizer.
                hasPermission(projectId, personId, "system.project.iteration.story", 10, "read.test");
        assertTrue("wrong result", result);

        // resource type wildcard, resourceId non match, permission name wildcard
        result = authorizer.
                hasPermission(projectId, personId, "system.project.iteration.story", 11, "write.test");
        assertFalse("wrong result", result);
    }
View Full Code Here

TOP

Related Classes of org.nxplanner.security.auth.Authorizer

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.