diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java index bf3d48e4cfec..4cd147deb153 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java @@ -113,10 +113,11 @@ public boolean resourcePermissionCheck(Object authorizationType, Object[] needCh if (Objects.nonNull(needChecks) && needChecks.length > 0) { Set originResSet = new HashSet<>(Arrays.asList(needChecks)); Set ownResSets = RESOURCE_LIST_MAP.get(authorizationType).listAuthorizedResource(userId, logger); - originResSet.removeAll(ownResSets); - if (CollectionUtils.isNotEmpty(originResSet)) + boolean checkResult = ownResSets != null && ownResSets.containsAll(originResSet); + if (!checkResult) { logger.warn("User does not have resource permission on associated resources, userId:{}", userId); - return CollectionUtils.isEmpty(originResSet); + } + return checkResult; } return true; }