Package eu.planets_project.ifr.core.security.api.model

Examples of eu.planets_project.ifr.core.security.api.model.Role


   
        int i = 0;
   
        if (userRoles.length > 0) {
            for (Iterator<Role> it = getRoles().iterator(); it.hasNext();) {
                Role role = it.next();
   
                userRoles[i] = role.getName();
                i++;
            }
        }
   
        if (userRoles.length == 0) {
View Full Code Here


   
        int i = 0;
   
        if (userRoles.length > 0) {
            for (Iterator<Role> it = getRoles().iterator(); it.hasNext();) {
                Role role = it.next();
   
                userRoles[i] = role.getName();
                i++;
            }
        }
   
        if (userRoles.length == 0) {
View Full Code Here

              break;
            }
          }
          // If the role wasn't found then add it to the user
          if (!roleFound) {
            Role userRole = roleManager.getRoleByName(newRole);
            this.user.addRole(userRole);
          }
      }
    } catch (RuntimeException e) {
      // Catch for Runtime Exceptions from the roleManager
View Full Code Here

    log.info("creating query");
    Query query = manager.createQuery("SELECT r FROM RoleImpl AS r WHERE r.name =:name");
    log.info("setting parameter name to " + name);
    query.setParameter("name", name);
    log.info("query.getsingleresult()");
    Role role = null;
    try {
      log.info("In catch block to retrieve user");
      role = (Role)query.getSingleResult();
    } catch (NoResultException e) {
      // Catch the runtime exception and set user to null
      log.info("Role doesn't exist so setting to null");
      role = null;
    }
    log.info("testing for role == null");
    if( role == null ) throw new RoleNotFoundException();
    log.info("Role name = " + role.getName());
    return role;
  }
View Full Code Here

TOP

Related Classes of eu.planets_project.ifr.core.security.api.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.