You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by GitBox <gi...@apache.org> on 2022/10/22 11:17:42 UTC

[GitHub] [incubator-streampark] 1996fanrui commented on a diff in pull request #1883: [Feature] Reduce unnecessary database join

1996fanrui commented on code in PR #1883:
URL: https://github.com/apache/incubator-streampark/pull/1883#discussion_r1002444475


##########
streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml:
##########
@@ -32,8 +32,7 @@
         select r.*
         from t_role r
         left join t_member m on r.role_id = m.role_id
-        left join t_user u on u.user_id = m.user_id
-        where u.user_id = #{userId}
+        where m.user_id = #{userId}

Review Comment:
   After check, I don't know why need to call `findUserRole`?
   
   There are two places in the code where roles are used, but I don't know why?
   
   1. `ShiroRealm.doGetAuthorizationInfo` -> `simpleAuthorizationInfo.setRoles(roleSet)`
   2. `UserServiceImpl.generateFrontendUserInfo` -> `userInfo.put("roles", roles);` 
   
   Do you know why need roles here? As I understand, front-end just needs the `permissions` and `routers`.



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org