Examples of RoleIdentifier


Examples of org.sonatype.security.usermanagement.RoleIdentifier

    user.setEmailAddress(simpleUser.getEmail());
    user.setName(simpleUser.getName());
    user.setUserId(simpleUser.getUserId());
    user.setStatus(UserStatus.active);
    for (String role : simpleUser.getRoles()) {
      RoleIdentifier plexusRole = new RoleIdentifier(this.getSource(), role);
      user.addRole(plexusRole);
    }
    // set the source of this user to this
    user.setSource(this.getSource());
View Full Code Here

Examples of org.sonatype.security.usermanagement.RoleIdentifier

    // set the users source
    user.setSource(DEFAULT_SOURCE);

    Set<RoleIdentifier> roles = new HashSet<RoleIdentifier>();
    for (String roleId : resource.getRoles()) {
      roles.add(new RoleIdentifier(DEFAULT_SOURCE, roleId));
    }

    user.setRoles(roles);

    return user;
View Full Code Here

Examples of org.sonatype.security.usermanagement.RoleIdentifier

    // FIXME: loss of roles source, currently we only support CRUDS on the XML realm but, that is temporary.

    Set<RoleIdentifier> roleIdentifiers = new HashSet<RoleIdentifier>();

    for (String roleId : (List<String>) restRoleMapping.getRoles()) {
      roleIdentifiers.add(new RoleIdentifier(DEFAULT_SOURCE, roleId));
    }

    return roleIdentifiers;
  }
View Full Code Here

Examples of org.sonatype.security.usermanagement.RoleIdentifier

    }
    return result;
  }

  protected RoleIdentifier createFakeRole(String roleId) {
    RoleIdentifier role = new RoleIdentifier(this.getSource(), roleId);
    return role;
  }
View Full Code Here

Examples of org.sonatype.security.usermanagement.RoleIdentifier

    user.setSource(LdapPlugin.USER_SOURCE);
    user.setStatus(UserStatus.active);


    for (String roleId : ldapUser.getMembership()) {
      RoleIdentifier role = new RoleIdentifier(LdapPlugin.USER_SOURCE, roleId);
      user.addRole(role);
    }

    return user;
  }
View Full Code Here

Examples of org.sonatype.security.usermanagement.RoleIdentifier

    DefaultUser a = new DefaultUser();
    a.setName("Joe Coder");
    a.setEmailAddress("jcoder@sonatype.org");
    a.setSource(this.getSource());
    a.setUserId("jcoder");
    a.addRole(new RoleIdentifier(this.getSource(), "RoleA"));
    a.addRole(new RoleIdentifier(this.getSource(), "RoleB"));
    a.addRole(new RoleIdentifier(this.getSource(), "RoleC"));

    DefaultUser b = new DefaultUser();
    b.setName("Christine H. Dugas");
    b.setEmailAddress("cdugas@sonatype.org");
    b.setSource(this.getSource());
    b.setUserId("cdugas");
    b.addRole(new RoleIdentifier(this.getSource(), "RoleA"));
    b.addRole(new RoleIdentifier(this.getSource(), "RoleB"));
    b.addRole(new RoleIdentifier(this.getSource(), "Role1"));

    DefaultUser c = new DefaultUser();
    c.setName("Patricia P. Peralez");
    c.setEmailAddress("pperalez@sonatype.org");
    c.setSource(this.getSource());
View Full Code Here

Examples of org.sonatype.security.usermanagement.RoleIdentifier

    a.setName("Brenda D. Burton");
    a.setEmailAddress("bburton@sonatype.org");
    a.setSource(this.getSource());
    a.setUserId("bburton");
    a.setStatus(UserStatus.active);
    a.addRole(new RoleIdentifier(this.getSource(), "RoleA"));
    a.addRole(new RoleIdentifier(this.getSource(), "RoleB"));
    a.addRole(new RoleIdentifier(this.getSource(), "RoleC"));

    DefaultUser b = new DefaultUser();
    b.setName("Julian R. Blevins");
    b.setEmailAddress("jblevins@sonatype.org");
    b.setSource(this.getSource());
    b.setUserId("jblevins");
    b.setStatus(UserStatus.active);
    b.addRole(new RoleIdentifier(this.getSource(), "RoleA"));
    b.addRole(new RoleIdentifier(this.getSource(), "RoleB"));

    DefaultUser c = new DefaultUser();
    c.setName("Kathryn J. Simmons");
    c.setEmailAddress("ksimmons@sonatype.org");
    c.setSource(this.getSource());
    c.setUserId("ksimmons");
    c.setStatus(UserStatus.active);
    c.addRole(new RoleIdentifier(this.getSource(), "RoleA"));
    c.addRole(new RoleIdentifier(this.getSource(), "RoleB"));

    DefaultUser d = new DefaultUser();
    d.setName("Florence T. Dahmen");
    d.setEmailAddress("fdahmen@sonatype.org");
    d.setSource(this.getSource());
    d.setUserId("fdahmen");
    d.setStatus(UserStatus.active);
    d.addRole(new RoleIdentifier(this.getSource(), "RoleA"));
    d.addRole(new RoleIdentifier(this.getSource(), "RoleB"));

    DefaultUser e = new DefaultUser();
    e.setName("Jill  Codar");
    e.setEmailAddress("jcodar@sonatype.org");
    e.setSource(this.getSource());
    e.setUserId("jcodar");
    e.setStatus(UserStatus.active);

    DefaultUser f = new DefaultUser();
    f.setName("Joe Coder");
    f.setEmailAddress("jcoder@sonatype.org");
    f.setSource(this.getSource());
    f.setUserId("jcoder");
    f.setStatus(UserStatus.active);
    f.addRole(new RoleIdentifier(this.getSource(), "Role1"));
    f.addRole(new RoleIdentifier(this.getSource(), "Role2"));
    f.addRole(new RoleIdentifier(this.getSource(), "Role3"));

    this.addUser(a, a.getUserId());
    this.addUser(b, b.getUserId());
    this.addUser(c, c.getUserId());
    this.addUser(d, d.getUserId());
View Full Code Here

Examples of org.sonatype.security.usermanagement.RoleIdentifier

    // jcohen.setName( "James E. Cohen" );
    // jcohen.setReadOnly( true );
    jcohen.setSource("Mock");
    jcohen.setStatus(UserStatus.active);
    jcohen.setUserId("jcohen");
    jcohen.addRole(new RoleIdentifier("Mock", "mockrole1"));
    users.add(jcohen);

    return users;
  }
View Full Code Here

Examples of org.sonatype.security.usermanagement.RoleIdentifier

  public Set<User> searchUsers(UserSearchCriteria criteria) {
    return this.filterListInMemeory(this.listUsers(), criteria);
  }

  protected RoleIdentifier createFakeRole(String roleId) {
    RoleIdentifier role = new RoleIdentifier(this.getSource(), roleId);
    return role;
  }
View Full Code Here

Examples of org.sonatype.security.usermanagement.RoleIdentifier

    user.setUserId("testCreateUser");
    user.setName(user.getUserId() + "-name");
    user.setSource(user.getUserId() + "default");
    user.setEmailAddress("email@email");
    user.setStatus(UserStatus.active);
    user.addRole(new RoleIdentifier("default", "role1"));
    user.addRole(new RoleIdentifier("default", "role3"));

    userManager.addUser(user, "my-password");

    ConfigurationManager config = this.getConfigurationManager();
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.