qicz opened a new issue #2266:
URL: https://github.com/apache/incubator-shenyu/issues/2266


   ### Volunteer help
   
   the standard user adds some selectors or rules and sync to the 
`data_permission` table automatically. 
   this action will isolate the standard user data.
   
   current implementation was check the permission data.
   ```java
               // check selector add
               if 
(dataPermissionMapper.listByUserId(JwtUtils.getUserInfo().getUserId()).size() > 
0) {
                   DataPermissionDTO dataPermissionDTO = new 
DataPermissionDTO();
                   
dataPermissionDTO.setUserId(JwtUtils.getUserInfo().getUserId());
                   dataPermissionDTO.setDataId(selectorDO.getId());
                   
dataPermissionDTO.setDataType(AdminConstants.SELECTOR_DATA_TYPE);
                   
dataPermissionMapper.insertSelective(DataPermissionDO.buildPermissionDO(dataPermissionDTO));
               }
   ```
   
   refer the user's role is the best. the front use the username `admin` to 
affirm the user's role, the backend can use the same logic.


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