Examples of GrantedAuthorityImpl


Examples of org.acegisecurity.GrantedAuthorityImpl

        GrantedAuthority[] authorities =
            new GrantedAuthorityImpl[userData.getRoles().size()];
        int i = 0;
        for (Iterator it = userData.getRoles().iterator(); it.hasNext();) {
            UserRole role = (UserRole)it.next();
            authorities[i++] = new GrantedAuthorityImpl(role.getRole());
        }
       
        return new org.acegisecurity.userdetails.User(
            userData.getUserName(), userData.getPassword(), true, authorities);
    }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

        if (defaultRole != null) roleCount++;
        GrantedAuthority[] authorities = new GrantedAuthorityImpl[roleCount];
        int i = 0;
        for (Iterator it = userData.getRoles().iterator(); it.hasNext();) {
            UserRole role = (UserRole) it.next();
            authorities[i++] = new GrantedAuthorityImpl(role.getRole());
        }
       
        if (defaultRole != null) {
            authorities[roleCount-1] = defaultRole;
        }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

     *
     * @param defaultRole the role name, including any desired prefix.
     */
    public void setDefaultRole(String defaultRole) {
        Assert.notNull(defaultRole, "The defaultRole property cannot be set to null");
        this.defaultRole = new GrantedAuthorityImpl(defaultRole);
    }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

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

Examples of org.acegisecurity.GrantedAuthorityImpl

    }

    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

Examples of org.acegisecurity.GrantedAuthorityImpl

     
      Iterator iter = roleSet.iterator();
      for (int i = (auth.getAuthorities() != null ? auth.getAuthorities().length : 0);
           i < ga.length;
           i++){
             ga[i] = new GrantedAuthorityImpl((String)iter.next());
           }

    UsernamePasswordAuthenticationToken upat =
      new UsernamePasswordAuthenticationToken(
          new User(auth.getName(),
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

    @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, 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

Examples of org.acegisecurity.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, null);
        milUser = new TestingAuthenticationToken("military", "supersecret", new GrantedAuthority[] {
                new GrantedAuthorityImpl("MILITARY") });

    }
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

        }
    }
   
    public void testSetUser() throws Exception {
        dao.setUser(new User("wfs", "pwd", true, true, true, true,
                new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_WFS_ALL"), new GrantedAuthorityImpl("ROLE_WMS_ALL")}));
        UserDetails user = dao.loadUserByUsername("wfs");
        assertEquals("wfs", user.getUsername());
        assertEquals("pwd", user.getPassword());
        assertEquals(2, user.getAuthorities().length);
        // ok... order dependent... making one non order dep takes too much time...
View Full Code Here

Examples of org.acegisecurity.GrantedAuthorityImpl

    }
   
    public void testSetMissingUser() throws Exception {
        try {
            dao.setUser(new User("notther", "pwd", true, true, true, true,
                    new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_WFS_ALL")}));
            fail("The user is not there, setUser should fail");
        } catch(IllegalArgumentException e) {
            // cool
        }
    }
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.