Browse Source

fix 2598:change getId to getUserId (#2757)

* fix #2598:allow to update resource suffix,but if it is authorized to other users,it is not allowed.

* add RESOURCE_IS_AUTHORIZED status

* verify whether the suffix is empty

* remove extra variables

* fix code smell

* change getId to getUserId
pull/3/MERGE
lgcareer 5 years ago committed by GitHub
parent
commit
911053ebfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java

@ -368,7 +368,7 @@ public class ResourcesService extends BaseService {
List<ResourcesUser> resourcesUsers = resourceUserMapper.selectByMap(columnMap); List<ResourcesUser> resourcesUsers = resourceUserMapper.selectByMap(columnMap);
if (CollectionUtils.isNotEmpty(resourcesUsers)) { if (CollectionUtils.isNotEmpty(resourcesUsers)) {
List<Integer> userIds = resourcesUsers.stream().map(ResourcesUser::getId).collect(Collectors.toList()); List<Integer> userIds = resourcesUsers.stream().map(ResourcesUser::getUserId).collect(Collectors.toList());
List<User> users = userMapper.selectBatchIds(userIds); List<User> users = userMapper.selectBatchIds(userIds);
String userNames = users.stream().map(User::getUserName).collect(Collectors.toList()).toString(); String userNames = users.stream().map(User::getUserName).collect(Collectors.toList()).toString();
logger.error("resource is authorized to user {},suffix not allowed to be modified", userNames); logger.error("resource is authorized to user {},suffix not allowed to be modified", userNames);

Loading…
Cancel
Save