Examples of UserRole


Examples of org.apache.roller.weblogger.pojos.UserRole

        int roleCount = userData.getRoles().size();
        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.cipres.treebase.domain.admin.UserRole

  /**
   *
   * @see org.cipres.treebase.domain.admin.UserHome#getUserRole()
   */
  public UserRole getUserRole() {
    UserRole role = new UserRole();
    role.setAuthority("User");
    return role;
  }
View Full Code Here

Examples of org.convey.user.registration.model.UserRole


    @Test
    public void testAddNewUserRole(){

        UserRole testUserRole1 = new UserRole();

        testUserRole1.setRoleName("ROLE_ADMIN");
        testUserRole1.setRoleDescription("Administrator Role");
        testUserRole1.setDateCreated(new Date());

        UserRole testUserRole1Persisted = userRoleDao.addNewUserRole(testUserRole1);

        Assert.assertEquals(testUserRole1,testUserRole1Persisted);


        UserRole testUserRole2 = new UserRole();

        testUserRole2.setRoleName("ROLE_CONSUMER");
        testUserRole2.setRoleDescription("Consumer User Role");
        testUserRole2.setDateCreated(new Date());

        UserRole testUserRole2Persisted = userRoleDao.addNewUserRole(testUserRole2);

        Assert.assertEquals(testUserRole2,testUserRole2Persisted);


    }// testAddNewUserRole
View Full Code Here

Examples of org.hoteia.qalingo.core.domain.UserRole

            String valueUserGroup = group.getName();
            userViewBean.getGroups().put(keyUserGroup, valueUserGroup);

            final Set<UserRole> roles = group.getRoles();
            for (Iterator<UserRole> iteratorRole = roles.iterator(); iteratorRole.hasNext();) {
                UserRole role = (UserRole) iteratorRole.next();
                String keyUserRole = role.getCode();
                String valueUserRole = role.getName();
                userViewBean.getRoles().put(keyUserRole, valueUserRole);

                final Set<UserPermission> permissions = role.getPermissions();
                for (Iterator<UserPermission> iteratorPermission = permissions.iterator(); iteratorPermission.hasNext();) {
                    UserPermission permission = (UserPermission) iteratorPermission.next();
                    String keyUserPermission = permission.getCode();
                    String valueUserPermission = permission.getName();
                    userViewBean.getPermissions().put(keyUserPermission, valueUserPermission);
View Full Code Here

Examples of org.jresearch.flexess.core.model.impl.UserRole

        removeUserRole(userId, applicationId, roleId);
      }
    }

    for (IRoleInstanceMetaInfo role : rm) {
      UserRole urole = new UserRole();
      urole.setRoleInstance((RoleInstanceMetaInfo) role);
      urole.setUserID(userId);
      urole.setApplication(applicationMetaInfo);
      if (!userRole.contains(urole)) {
        em.merge(urole);
        // getHibernateTemplate().save(urole);
      }
    }
View Full Code Here

Examples of org.jrest4guice.security.UserRole

     
      //获取模板
      Template template = this.engine.getTemplate(url);
      //往上下文中填入数据
      this.context.put("ctxPath", this.request.getContextPath());
      UserRole userPrincipal = this.securityContext.getUserPrincipal();
      this.context.put(SecurityContext.CURRENT_USER_ROlE, userPrincipal);
      this.context.put(SecurityContext.USER_IS_LOGIN, userPrincipal!=null);
      this.context.put("ctx", result);
      this.context.put("xctx",session.getAttribute(HtmlResponseWriter.OPTION_KEY));
     
View Full Code Here

Examples of org.jrest4guice.security.UserRole

      List innerElements) throws Exception {
    if (param != null){
     
      Object useRoleObj = context.getVariable(SecurityContext.CURRENT_USER_ROlE);
      if(useRoleObj != null){
        UserRole ur = (UserRole)useRoleObj;
        String roles[] = {param.toString()};
        if(param instanceof List){
          roles = (String[])((List)param).toArray(new String[]{});
        }
       
        boolean hasRole = false;
        List<Role> uRoles = ur.getRoles();
        top: for (String role : roles) {
          for (Role r : uRoles) {
            if (role.equalsIgnoreCase(r.getName())) {
              hasRole = true;
              break top;
View Full Code Here

Examples of org.jrest4guice.security.UserRole

  @Get
  @Path("auth")
  public boolean authUser(String userName, String userPassword) {
    boolean result = this.domain.authUser(userName, userPassword);
    if (result) {
      UserRole userRole = new UserRole();
      User user = new User();
      List<Role> roles = this.listUserRoles(userName);
      userRole.setUser(user);
      userRole.setRoles(roles);
     
      //缓存当前用户的权限信息
      this.securityContext.storeUserPrincipal(userName, userRole);
    }
    return result;
View Full Code Here

Examples of org.jrest4guice.security.UserRole

  private SecurityContext securityContext;
 
  @Get
  public List<Role> listUserPrincipal(){
    System.out.println("==listUserPrincipal==");
    final UserRole userPrincipal = this.securityContext.getUserPrincipal();
    if(userPrincipal != null){
      for(Role role:userPrincipal.getRoles()){
        System.out.println(role.getName());
      }
     
      return userPrincipal.getRoles();
    }
   
    return null;
  }
View Full Code Here

Examples of org.libreplan.business.users.entities.UserRole

    public RowRenderer getRolesRenderer() {
        return new RowRenderer() {
            @Override
            public void render(Row row, Object data) throws Exception {
                final UserRole role = (UserRole) data;

                row.appendChild(new Label(_(role.getDisplayName())));

                row.appendChild(Util.createRemoveButton(new EventListener() {
                    @Override
                    public void onEvent(Event event) throws Exception {
                        removeRole(role);
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.