Spring Boot + Spring Security: URL-based dynamic permissions: Custom Filter - section 17

Demand origin

       In the last of our custom AccessDesionManager achieved through dynamic control authority, this section will achieve dynamic permission by custom Filter carried out to understand the article, then, for this article did not fairly simple. Code is based on: the encoded down "URL dynamic permissions based on the preparatory work."

Coding ideas

       URL for dynamic configuration rights, mainly to solve the following problems:

(1) user rights information stored in the URL where based on: the need to define a permission form, save the right information, then there is a relationship roles and privileges (preparatory work has been completed).

(2) how to load a user's privileges: You can still be loaded through loadUserByUsername, authority information of the user of this coding change (already encoded before).

(3) authority URL corresponding configuration: This is mainly configured by FilterInvocationSecurityMetadataSource.

(4) How to determine whether a user has permission to access a URL: Custom AccessDecisionManager class

Guess you like

Origin blog.csdn.net/linxingliang/article/details/104818565