lenboo commented on a change in pull request #7356:
URL: https://github.com/apache/dolphinscheduler/pull/7356#discussion_r767453379



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
##########
@@ -578,6 +579,62 @@ public Result queryUserList(User loginUser, String 
searchVal, Integer pageNo, In
         return result;
     }
 
+    /**
+     * grant project by code
+     *
+     * @param loginUser login user
+     * @param userId user id
+     * @param projectCodes project code array
+     * @return grant result code
+     */
+    @Override
+    public Map<String, Object> grantProjectByCode(final User loginUser, final 
int userId, final String projectCodes) {
+        Map<String, Object> result = new HashMap<>();
+        result.put(Constants.STATUS, false);
+
+        // 1. only admin can operate
+        if (this.check(result, !this.isAdmin(loginUser), 
Status.USER_NO_OPERATION_PERM)) {
+            return result;

Review comment:
       'only admin can operate' is maybe not a good idea.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to