Skip to content

Commit

Permalink
Lsh/team management compatibility (#113)
Browse files Browse the repository at this point in the history
* Add roleName in SysUser class, for directly use;
Add "managable" variable in SysTeam class, for team management page to upload;

* Fix: ADMIN can get all SysTeam record;
Set manageable = false for newly created object;

* Default team cannot be deleted.
Optimize user existence check when the only member is the requestor to delete the team.

* Default team cannot be deleted.
Optimize user existence check when the only member is the requestor to delete the team.

* Create a new API as the old API is used in other place and hence it's targeting function should not be modified.

* - Modify /userTeam/addRelation API, use mailAddress instead of userId as input;
- Optimize logic of setting SysTeam list manageable attribute;
- Modify /userTeam/queryUsers API:
  - Add manageable attribute;
  - Remove Default team member when requestor's ROLE is USER;
  - Set manageable = true for only the requestor when requestor's ROLE is USER;

* Modify /queryUsers API

* NPE check for teamAdmin set
  • Loading branch information
olivershen-wow committed Nov 3, 2022
1 parent 9af4d03 commit 33dc274
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ public List<SysUser> queryUsersByTeam(String teamId) {
public List<SysUser> queryTeamUsersWithTeamAdmin(String teamId) {
List<SysUser> allUsers = queryUsersByTeam(teamId);
Set<String> teamAdminSet = teamAdminListMap.get(teamId);
allUsers.forEach(user -> {
if (teamAdminSet.contains(user.getMailAddress())) {
user.setTeamAdmin(true);
}
else {
user.setTeamAdmin(false);
}
});
if (!CollectionUtils.isEmpty(teamAdminSet)) {
allUsers.forEach(user -> {
if (teamAdminSet.contains(user.getMailAddress())) {
user.setTeamAdmin(true);
}
else {
user.setTeamAdmin(false);
}
});
}

return allUsers;
}
Expand Down

0 comments on commit 33dc274

Please sign in to comment.