diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java index 8b40a2574360..8ccbff1e2f50 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java @@ -120,9 +120,11 @@ public Map createToken(User loginUser, int userId, String expire */ public Map generateToken(User loginUser, int userId, String expireTime) { Map result = new HashMap<>(5); - if(check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)){ + if (!hasPerm(loginUser,userId)){ + putMsg(result, Status.USER_NO_OPERATION_PERM); return result; } + String token = EncryptionUtils.getMd5(userId + expireTime + String.valueOf(System.currentTimeMillis())); result.put(Constants.DATA_LIST, token); putMsg(result, Status.SUCCESS);