Package org.jamwiki.authentication

Examples of org.jamwiki.authentication.RoleImpl


      try {
        // once created a role name cannot be modified, so the text field
        // will be disabled in the form.
        boolean update = StringUtils.isBlank(request.getParameter("roleName"));
        String roleName = (update) ? updateRole : request.getParameter("roleName");
        role = new RoleImpl(roleName);
        role.setDescription(request.getParameter("roleDescription"));
        WikiUtil.validateRole(role);
        WikiBase.getDataHandler().writeRole(role, update);
        if (!StringUtils.isBlank(updateRole) && updateRole.equals(role.getAuthority())) {
          next.addObject("message", new WikiMessage("roles.message.roleupdated", role.getAuthority()));
View Full Code Here


  @Override
  public List<Role> getRoleMapGroup(String groupName) throws DataAccessException {
    QueryResultIterable<GroupAuthorityEntity> list = GroupAuthorityService.getByGroupname(groupName);
    if (list != null) {
      List<Role> roles = new ArrayList<Role>();
      RoleImpl role;
      for (GroupAuthorityEntity entity : list) {
        role = new RoleImpl(entity.getAuthority());
        role.setDescription(entity.getGroupName());
        roles.add(role);
      }
      return roles;
    }
    return null;
View Full Code Here

  @Override
  public List<Role> getRoleMapUser(String login) throws DataAccessException {
    // TODO Auto-generated method stub
    QueryResultIterable<AuthorityEntity> list = AuthorityService.findByName(login);
    RoleImpl roleImpl;
    List<Role> roles = new ArrayList<Role>();
    for (AuthorityEntity authorityEntity : list) {
      roleImpl = new RoleImpl(authorityEntity.getAuthority());
      roleImpl.setDescription(roleImpl.getDescription());
    }
    return roles;
  }
View Full Code Here

    throw new NotImplementedException("getWatchlist");
    // return null;
  }

  private Role initRole(RoleEntity rs) {
    Role role = new RoleImpl(rs.getName());
    role.setDescription(rs.getDescription());
    return role;
  }
View Full Code Here

TOP

Related Classes of org.jamwiki.authentication.RoleImpl

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.