Package org.geoserver.security

Examples of org.geoserver.security.DataAccessManager.canAccess()


        assertFalse(wo.canAccess(rwUser, basesLayer, AccessMode.WRITE));
        assertTrue(wo.canAccess(milUser, basesLayer, AccessMode.READ));
        assertTrue(wo.canAccess(milUser, basesLayer, AccessMode.WRITE));
       
        // check the layer with dots
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.WRITE));
View Full Code Here


        assertTrue(wo.canAccess(milUser, basesLayer, AccessMode.READ));
        assertTrue(wo.canAccess(milUser, basesLayer, AccessMode.WRITE));
       
        // check the layer with dots
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.WRITE));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.READ));
View Full Code Here

        assertTrue(wo.canAccess(milUser, basesLayer, AccessMode.WRITE));
       
        // check the layer with dots
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.WRITE));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.READ));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.WRITE));
View Full Code Here

       
        // check the layer with dots
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.WRITE));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.READ));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.WRITE));
    }
View Full Code Here

        // check the layer with dots
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.WRITE));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.READ));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.WRITE));
    }
   
View Full Code Here

        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.WRITE));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.READ));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.WRITE));
    }
   
    @Test
View Full Code Here

        assertFalse(wo.canAccess(anonymous, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.WRITE));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.READ));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.WRITE));
    }
   
    @Test
    public void testDefaultMode() throws Exception {
View Full Code Here

        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(roUser, arcGridLayer, AccessMode.WRITE));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.READ));
        assertFalse(wo.canAccess(rwUser, arcGridLayer, AccessMode.WRITE));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.READ));
        assertTrue(wo.canAccess(milUser, arcGridLayer, AccessMode.WRITE));
    }
   
    @Test
    public void testDefaultMode() throws Exception {
        DataAccessManager wo = buildLegacyAccessManager("lockedDown.properties");
View Full Code Here

    @Override
    protected void onSetUp(SystemTestData testData) throws Exception {
        super.onSetUp(testData);
        //Create a mock access manager that will grant read but deny write access to everyone
        DataAccessManager mockManager = createMock(DataAccessManager.class);
        expect(mockManager.canAccess((Authentication) anyObject(), (WorkspaceInfo) anyObject(), eq(AccessMode.READ))).andReturn(true).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (WorkspaceInfo) anyObject(), eq(AccessMode.WRITE))).andReturn(false).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (WorkspaceInfo) anyObject(), eq(AccessMode.ADMIN))).andReturn(false).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (ResourceInfo) anyObject(), eq(AccessMode.READ))).andReturn(true).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (ResourceInfo) anyObject(), eq(AccessMode.WRITE))).andReturn(false).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (LayerInfo) anyObject(), eq(AccessMode.READ))).andReturn(true).anyTimes();
View Full Code Here

    protected void onSetUp(SystemTestData testData) throws Exception {
        super.onSetUp(testData);
        //Create a mock access manager that will grant read but deny write access to everyone
        DataAccessManager mockManager = createMock(DataAccessManager.class);
        expect(mockManager.canAccess((Authentication) anyObject(), (WorkspaceInfo) anyObject(), eq(AccessMode.READ))).andReturn(true).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (WorkspaceInfo) anyObject(), eq(AccessMode.WRITE))).andReturn(false).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (WorkspaceInfo) anyObject(), eq(AccessMode.ADMIN))).andReturn(false).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (ResourceInfo) anyObject(), eq(AccessMode.READ))).andReturn(true).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (ResourceInfo) anyObject(), eq(AccessMode.WRITE))).andReturn(false).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (LayerInfo) anyObject(), eq(AccessMode.READ))).andReturn(true).anyTimes();
        expect(mockManager.canAccess((Authentication) anyObject(), (LayerInfo) anyObject(), eq(AccessMode.WRITE))).andReturn(false).anyTimes();
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.