Examples of GrantedAuthorityImpl


Examples of org.acegisecurity.GrantedAuthorityImpl

        }
    }
   
    public void testAddUser() throws Exception {
        dao.putUser(new User("newuser", "pwd", true, true, true, true,
                new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_WFS_ALL")}));
        assertNotNull(dao.loadUserByUsername("newuser"));
    }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

    }
   
    public void addExistingUser() throws Exception {
        try {
            dao.putUser(new User("admin", "pwd", true, true, true, true,
                    new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_WFS_ALL")}));
            fail("The user is already there, addUser should fail");
        } catch(IllegalArgumentException e) {
            // cool
        }
    }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

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

Examples of org.acegisecurity.GrantedAuthorityImpl

    @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

Examples of org.acegisecurity.GrantedAuthorityImpl

        SecurityContextHolder.getContext().setAuthentication(
            new UsernamePasswordAuthenticationToken(
            "admin",
            "geoserver",
            new GrantedAuthority[]{
                new GrantedAuthorityImpl("ROLE_ADMINISTRATOR")
            }
            )
        );
    }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

        SecurityContextHolder.getContext().setAuthentication(
            new UsernamePasswordAuthenticationToken(
            "anonymousUser",
            "",
            new GrantedAuthority[]{
                new GrantedAuthorityImpl("ROLE_ANONYMOUS")
            }
            )
        );
    }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

         */

        GrantedAuthority[] toGrantedAuthorities(List<String> roles) {
            GrantedAuthority[] authorities = new GrantedAuthority[roles.size()];
            for (int i = 0; i < authorities.length; i++) {
                authorities[i] = new GrantedAuthorityImpl(roles.get(i));
            }
            return authorities;
        }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

    public void addAuthority(GrantedAuthority newAuthority) {
        this.authorities.add(newAuthority);
    }

    public GrantedAuthority[] getAuthorities() {
        GrantedAuthority[] toReturn = {new GrantedAuthorityImpl("demo")};

        return (GrantedAuthority[]) this.authorities.toArray(toReturn);
    }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

     */
    public void setAuthoritiesAsString(List authoritiesAsString) {
        setAuthorities(new ArrayList(authoritiesAsString.size()));
        Iterator it = authoritiesAsString.iterator();
        while (it.hasNext()) {
            GrantedAuthority grantedAuthority = new GrantedAuthorityImpl((String) it.next());
            addAuthority(grantedAuthority);
        }
    }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

            role = StringUtils.replace(role, "\t", "");
            role = StringUtils.replace(role, "\r", "");
            role = StringUtils.replace(role, "\n", "");
            role = StringUtils.replace(role, "\f", "");

            requiredAuthorities.add(new GrantedAuthorityImpl(role));
        }

        return requiredAuthorities;
    }
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.