Package com.sivalabs.springmvc.entities

Examples of com.sivalabs.springmvc.entities.Role


  public static Set<Role> getRoles(Collection<? extends GrantedAuthority> authorities) {
    Set<Role> roles = new HashSet<>();
    for (GrantedAuthority authority : authorities) {
      String roleName = authority.getAuthority();
      roles.add(new Role(roleName));
    }
    return roles;
  }
View Full Code Here


  void initDatabase()
  {

    logger.info("Initializing Database with sample data");
   
    Role role1 = new Role("ROLE_USER");
    Role role2 = new Role("ROLE_ADMIN");
   
    User user1 = new User(1, "admin", "admin", "Administrator", "admin@gmail.com");
    User user2 = new User(2, "siva", "siva", "Siva", "sivaprasadreddy.k@gmail.com");
   
    user1.addRoles(role1, role2);
View Full Code Here

TOP

Related Classes of com.sivalabs.springmvc.entities.Role

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.