This is an automated email from the ASF dual-hosted git repository.

lgcareer pushed a commit to branch 1.3.2-release
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/1.3.2-release by this push:
     new 8093cd4  modify general user can't create token (#3533)
8093cd4 is described below

commit 8093cd45532dca4fff5c5d0ad7cbf8cba2a91e68
Author: qiaozhanwei <[email protected]>
AuthorDate: Tue Aug 18 10:52:32 2020 +0800

    modify general user can't create token (#3533)
    
    * [Feature] JVM parameter optimization , related issue #3370
    
    * [Feature] JVM parameter optimization , related issue #3370
    
    * test release 1.3.2 version rollback
    
    * test release 1.3.2 version rollback
    
    * test
    
    * test release 1.3.2 version rollback
    
    * modify tag 1.3.0 to HEAD
    
    * modify general user can't create token
    
    Co-authored-by: qiaozhanwei <[email protected]>
---
 .../org/apache/dolphinscheduler/api/service/AccessTokenService.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 8b40a25..8ccbff1 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 class AccessTokenService extends BaseService {
      */
     public Map<String, Object> generateToken(User loginUser, int userId, 
String expireTime) {
         Map<String, Object> 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);

Reply via email to