Package com.agiletec.aps.system.services.group

Examples of com.agiletec.aps.system.services.group.Group


    UserDetails currentUser = (UserDetails) reqCtx.getRequest().getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
    List<Group> groups = authManager.getGroupsOfUser(currentUser);
    Set<String> allowedGroup = new HashSet<String>();
    Iterator<Group> iter = groups.iterator();
    while (iter.hasNext()) {
      Group group = iter.next();
      allowedGroup.add(group.getName());
    }
    allowedGroup.add(Group.FREE_GROUP_NAME);
    return allowedGroup;
  }
View Full Code Here


  private void loadUserDefaultGroups(User user) throws ApsSystemException {
    Set<String> groupNames = this.getConfig().getGroups();
    if (null != groupNames) {
      Iterator<String> it = groupNames.iterator();
      while (it.hasNext()) {
        Group group = this.getGroupManager().getGroup(it.next());
        ((IApsAuthorityManager) this.getGroupManager()).setUserAuthorization(user.getUsername(), group);
      }
    }
  }
View Full Code Here

  private List<String> searchTrashedResources(String resourceTypeCode, String text, UserDetails currentUser) throws ApsSystemException {
    List<String> allowedGroups = new ArrayList<String>();
    List<Group> userGroups = this.getAuthorizationManager().getGroupsOfUser(currentUser);
    for (int i=0; i<userGroups.size(); i++) {
      Group group = userGroups.get(i);
      if (group.getName().equals(Group.ADMINS_GROUP_NAME)) {
        allowedGroups.clear();
        break;
      } else {
        allowedGroups.add(group.getName());
      }
    }
    List<String> resourcesId = this.getTrashedResourceManager().searchTrashedResourceIds(resourceTypeCode, text, allowedGroups);
    return resourcesId;
  }
View Full Code Here

  private Set<String> getGroupsForSearch(List<Group> allowedGroups) {
    Set<String> groupForSearch = new HashSet<String>();
    groupForSearch.add(Group.FREE_GROUP_NAME);
    Iterator<Group> groupsIter = allowedGroups.iterator();
    while (groupsIter.hasNext()) {
      Group group = (Group) groupsIter.next();
      if (group.getName().equals(Group.ADMINS_GROUP_NAME)) {
        groupForSearch.addAll(getGroupManager().getGroupsMap().keySet());
        break;
      } else {
        groupForSearch.add(group.getName());
      }
    }
    return groupForSearch;
  }
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.services.group.Group

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.