dromara / sureness

A efficient security framework focus on protection of API.

Home Page:https://usthe.com/sureness

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

如何动态更新资源权限?

lwhua opened this issue · comments

commented

通过管理后台界面添加了资源和对应的角色授权,目前需要重启服务才能更新权限,如何动态更新资源权限?

@lwhua
Bot detected the issue body's language is not English, translate it automatically. For the convenience of others, please use English next time👯.


Title: How to dynamically update resource permissions?

Added resources and corresponding role authorization through the management background interface. Currently, the service needs to be restarted to update the permissions. How to dynamically update the resource permissions?

你好不用重启,可以通过TreePathRoleMatcher rebuildTree 来刷新权限树 具体操作可以参考 sample-tom 样例的 @PostMapping("/authority/resource/{roleId}/{resourceId}") 接口实现