tydhot commented on a change in pull request #2267:
URL: https://github.com/apache/incubator-shenyu/pull/2267#discussion_r738342735



##########
File path: 
shenyu-admin/src/main/java/org/apache/shenyu/admin/utils/JwtUtils.java
##########
@@ -41,6 +41,17 @@
 
     private static final long TOKEN_EXPIRE_SECONDS = 24 * 60 * 60 * 1000L;
 
+    private static final String ADMIN_USERNAME = "admin";
+
+    /**
+     * check current user is admin or not.
+     *
+     * @return true is admin
+     */
+    public static boolean isAdmin() {
+        return ADMIN_USERNAME.equals(getUserInfo().getUserName().trim());

Review comment:
       Are you serious about judging whether an account is admin in this way




-- 
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