Spring security, how to restrict user access certain resources based on dynamic roles?

前端 未结 3 1152
感动是毒
感动是毒 2021-02-06 06:16

given a scenario , there is a HTML contents OR some method in a controller, which only allow to be access by \"a\" role.

from above, we achieve by using

3条回答
  •  我在风中等你
    2021-02-06 06:52

    What if you use Java Reflection to get every controller method, then you asign any of these methods to role relation to build a "dynamic role"? This way you could add or remove any action to any role at any moment. Maybe Spring Security is not required this way.

提交回复
热议问题