fix(Bug修复): 非组织管理员获取组织下用户列表准备开通工作台时需进行错误提示:当前用户非组织管理员,无法开通工作台

This commit is contained in:
OTTO 2024-09-09 15:21:56 +08:00
parent 421b42b36a
commit b4fd5ece52
1 changed files with 6 additions and 0 deletions

View File

@ -225,6 +225,12 @@ public class PmsEnterpriseServiceImpl implements IPmsEnterpriseService {
List<GitLinkUserSimpleInfoVo> gitlinkUserList = pmsCommonService.getAllGitlinkUsersByOrgTeam(
pmsEnterprise.getEnterpriseIdentifier(), gitlinkOrganizationTeamVo.getId()
);
if ("owner".equalsIgnoreCase(gitlinkOrganizationTeamVo.getAuthorize())) {
boolean currentUserIsOwner = gitlinkUserList.stream().anyMatch(x -> x.getUserId().equals(SecurityUtils.getGitlinkUserId()));
if (!currentUserIsOwner) {
throw new ServiceException("当前用户非组织管理员,无法开通工作台");
}
}
for (GitLinkUserSimpleInfoVo gitLinkUserSimpleInfoVo : gitlinkUserList) {
if (gitLinkUserSimpleInfoVo.getUserId() == null) {
break;