Examples of IApsAuthority


Examples of com.agiletec.aps.system.services.authorization.IApsAuthority

    private Set<String> getGroupsForSearch(UserDetails currentUser) {
        Set<String> groupForSearch = new HashSet<String>();
        groupForSearch.add(Group.FREE_GROUP_NAME);
        IApsAuthority[] autorities = currentUser.getAuthorities();
        for (int i = 0; i < autorities.length; i++) {
            IApsAuthority autority = autorities[i];
            if (autority instanceof Group) {
                groupForSearch.add(autority.getAuthority());
            }
        }
        return groupForSearch;
    }
View Full Code Here

Examples of com.agiletec.aps.system.services.authorization.IApsAuthority

      List<IApsAuthority> userRoles = this.getRoleManager().getAuthorizationsByUser(extractedUsername);
      if (null == userRoles) {
        continue;
      }
      for (int j = 0; j < userRoles.size(); j++) {
        IApsAuthority role = userRoles.get(j);
        if (null == role) {
          continue;
        }
        if (roleNamesWithSupervisor.contains(role.getAuthority())) {
          supervisors.add(extractedUsername);
        }
        if (roleNamesWithEditor.contains(role.getAuthority())) {
          editors.add(extractedUsername);
        }
      }
    }
  }
View Full Code Here

Examples of com.agiletec.aps.system.services.authorization.IApsAuthority

    List<String> names = new ArrayList<String>();
    if (null == roles) {
      return names;
    }
    for (int i = 0; i < roles.size(); i++) {
      IApsAuthority role = roles.get(i);
      if (null == role) {
        continue;
      }
      names.add(role.getAuthority());
    }
    return names;
  }
View Full Code Here

Examples of com.agiletec.aps.system.services.authorization.IApsAuthority

      if (users.isEmpty() || roleName == null || roleName.length()==0) {
        usersForContentType = users;
      } else {
        usersForContentType = new ArrayList<String>();
        IApsAuthorityManager roleManager = this.getRoleManager();
        IApsAuthority authority = roleManager.getAuthority(roleName);
        List<String> usernamesWithAuth = this.getRoleManager().getUsernamesByAuthority(authority);
        for (int i = 0; i < users.size(); i++) {
          String username = users.get(i);
          if (null == username) {
            continue;
View Full Code Here

Examples of com.agiletec.aps.system.services.authorization.IApsAuthority

    if (usernames.isEmpty() || groupName == null || groupName.length()==0) {
      usersForContentType = usernames;
    } else {
      usersForContentType = new ArrayList<String>();
      IApsAuthorityManager groupManager = (IApsAuthorityManager) super.getBeanFactory().getBean(SystemConstants.GROUP_MANAGER);
      IApsAuthority authority = groupManager.getAuthority(groupName);
      List<String> usersWithAuth = groupManager.getUsernamesByAuthority(authority);
      for (int i = 0; i < usernames.size(); i++) {
        String username = usernames.get(i);
        if (null == username) {
          continue;
View Full Code Here

Examples of com.agiletec.aps.system.services.authorization.IApsAuthority

  }
 
  protected boolean userHasRole(String roleName) {
    boolean hasPermission = false;
    if(roleName!=null) {
      IApsAuthority authority = this.getRoleManager().getRole(roleName);
      if (authority!=null) {
        hasPermission = this.getAuthorizationManager().isAuth(this.getCurrentUser(), authority);
      }
    }
    return hasPermission;
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.