コード例 #1
0
ファイル: GroupService.java プロジェクト: nguillot/tatami
 public void removeMemberFromGroup(User user, Group group) {
   String groupId = group.getGroupId();
   Collection<String> userCurrentGroupIds = userGroupRepository.findGroups(user.getLogin());
   boolean userIsAlreadyAMember = false;
   for (String testGroupId : userCurrentGroupIds) {
     if (testGroupId.equals(groupId)) {
       userIsAlreadyAMember = true;
     }
   }
   if (userIsAlreadyAMember) {
     groupMembersRepository.removeMember(groupId, user.getLogin());
     groupCounterRepository.decrementGroupCounter(user.getDomain(), groupId);
     userGroupRepository.removeGroup(user.getLogin(), groupId);
   } else {
     if (log.isDebugEnabled()) {
       log.debug("User " + user.getLogin() + " is not a member of group " + group.getName());
     }
   }
 }
コード例 #2
0
ファイル: GroupService.java プロジェクト: nguillot/tatami
 public Collection<Group> getGroupsForCurrentUser() {
   User currentUser = authenticationService.getCurrentUser();
   Collection<String> groupIds = userGroupRepository.findGroups(currentUser.getLogin());
   return getGroupDetails(currentUser, groupIds);
 }