Package org.springframework.security

Examples of org.springframework.security.GrantedAuthorityImpl


        expect(catalog.getWorkspace((String) anyObject())).andReturn(
                createNiceMock(WorkspaceInfo.class)).anyTimes();
        replay(catalog);

        rwUser = new TestingAuthenticationToken("rw", "supersecret", new GrantedAuthority[] {
                new GrantedAuthorityImpl("READER"), new GrantedAuthorityImpl("WRITER") });
        roUser = new TestingAuthenticationToken("ro", "supersecret",
                new GrantedAuthority[] { new GrantedAuthorityImpl("READER") });
        anonymous = new TestingAuthenticationToken("anonymous", null);
        milUser = new TestingAuthenticationToken("military", "supersecret", new GrantedAuthority[] {
                new GrantedAuthorityImpl("MILITARY") });

    }
View Full Code Here


    @Override
    protected void setUpInternal() throws Exception {
        dao = GeoserverUserDao.get();
        dao.putUser(new User("user", "pwd", true, true, true, true,
                new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_WFS_ALL"), new GrantedAuthorityImpl("ROLE_WMS_ALL")}));
        login();
        tester.startPage(UserPage.class);
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
       
        rwUser = new TestingAuthenticationToken("rw", "supersecret", new GrantedAuthority[] {
                new GrantedAuthorityImpl("READER"), new GrantedAuthorityImpl("WRITER") });
        roUser = new TestingAuthenticationToken("ro", "supersecret",
                new GrantedAuthority[] { new GrantedAuthorityImpl("READER") });
        anonymous = new TestingAuthenticationToken("anonymous", null);
        milUser = new TestingAuthenticationToken("military", "supersecret",
                new GrantedAuthority[] { new GrantedAuthorityImpl("MILITARY") });
        root = new TestingAuthenticationToken("admin", "geoserver", new GrantedAuthority[] { new GrantedAuthorityImpl(SecureTreeNode.ROOT_ROLE) });

        catalog = createNiceMock(Catalog.class);
        expect(catalog.getWorkspace((String) anyObject())).andReturn(
                createNiceMock(WorkspaceInfo.class)).anyTimes();
        replay(catalog);
View Full Code Here

    true,
    true,
    true,
    true,
    new GrantedAuthority[]{
    new GrantedAuthorityImpl("ROLE_ADMINISTRATOR")
    }
    ));
  }
View Full Code Here

     * @return A list of granted authorities for a given username.
     */
    public List<GrantedAuthority> loadAuthoritiesByUsername(final String username)
    {
        List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>(1);
        authorities.add(new GrantedAuthorityImpl("ROLE_USER"));
        return authorities;
    }
View Full Code Here

        String[] roles = inGrantedAuthorities.split(",\\s*");
        grantedAuthorities = new GrantedAuthority[roles.length];
        for (int i = 0; i < roles.length; i++)
        {
            grantedAuthorities[i] = new GrantedAuthorityImpl(roles[i]);
        }
    }
View Full Code Here

    }

    public void testRoleAttributes() {

        UserDetailsImpl readerDetails = new UserDetailsImpl("reader", "pwreader",
                new GrantedAuthority[] { new GrantedAuthorityImpl("READER") });
        readerDetails.setPersNr(4711);
        GeometryFactory fac = new GeometryFactory();
        LinearRing r = fac.createLinearRing(new Coordinate[] { new Coordinate(11, 11),
                new Coordinate(14, 11), new Coordinate(14, 14), new Coordinate(11, 14),
                new Coordinate(11, 11), });
View Full Code Here

            Collection<Role> roles = directoryManager.getUserRoles(user.getUsername());
            List<GrantedAuthority> gaList = new ArrayList<GrantedAuthority>();

            if (roles != null && !roles.isEmpty()) {
                for (Role role : roles) {
                    GrantedAuthorityImpl ga = new GrantedAuthorityImpl(role.getId());
                    gaList.add(ga);
                }
            }

            return gaList.toArray(new GrantedAuthority[gaList.size()]);
View Full Code Here

        // get authorities
        Collection<Role> roles = directoryManager.getUserRoles(username);
        List<GrantedAuthority> gaList = new ArrayList<GrantedAuthority>();
        if (roles != null && !roles.isEmpty()) {
            for (Role role : roles) {
                GrantedAuthorityImpl ga = new GrantedAuthorityImpl(role.getId());
                gaList.add(ga);
            }
        }
        GrantedAuthority[] authorities = gaList.toArray(new GrantedAuthority[gaList.size()]);
View Full Code Here

            }
        }));
    }
   
    public void testRemoveDataAccessRule() {
        GrantedAuthority[] authorities = new GrantedAuthority[] { new GrantedAuthorityImpl("ROLE_FRANK") };
        setupPanel(new User("frank", "francesco", true, true, true, true, authorities));
       
        // print(tester.getLastRenderedPage(), true, true);
       
        tester.assertRenderedPage(FormTestPage.class);
View Full Code Here

TOP

Related Classes of org.springframework.security.GrantedAuthorityImpl

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.