Package org.dedeler.template.model

Examples of org.dedeler.template.model.Role


  public boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission) {

    Collection<GrantedAuthority> authorities = (Collection<GrantedAuthority>) authentication.getAuthorities();
    for (GrantedAuthority authority : authorities) {
      if(authority instanceof Role){
        Role role = (Role) authority;
        List<Privilege> privileges = role.getPrivileges();
        for (Privilege privilege : privileges) {
          if (permission.equals(privilege.getName())) {
            return true;
          }
        }       
View Full Code Here


          ApplicationContext applicationContext = ((ContextRefreshedEvent) event).getApplicationContext();

          RoleService roleService = applicationContext.getBean(RoleService.class);
          UserService userService = applicationContext.getBean(UserService.class);
         
          Role role = new Role("ROLE_USER");

          User user = new User();
          user.setUsername("admin");
          user.setPassword("7lLEodyoRSvB9W6Rhjc+xfabU0ITmcdbjaW4MfARG5TOb/N7TeMxDB85j/HSm8t1h6pTrATIXySR+yQ5jMo39Q==");// admin
          user.setFirstName("Destan");
View Full Code Here

  }

  @RequestMapping(value = "/createUser", method = RequestMethod.GET)
  @ResponseBody
  public long createUser() {
    Role role = new Role("ROLE_USER");
       
    User user = new User();
    user.setUsername("admin");
    user.setPassword("7lLEodyoRSvB9W6Rhjc+xfabU0ITmcdbjaW4MfARG5TOb/N7TeMxDB85j/HSm8t1h6pTrATIXySR+yQ5jMo39Q==");// admin
    user.setFirstName("Destan");
View Full Code Here

TOP

Related Classes of org.dedeler.template.model.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.