Setting user roles based on some kind of ownership in Spring Security

后端 未结 3 1138
心在旅途
心在旅途 2021-01-12 01:58

In my Spring-based application, I currently have basic roles such as ADMIN, and USER.

Is it possible to define a user role such as PHOTO_UPLOADER, which inherits fr

3条回答
  •  忘掉有多难
    2021-01-12 02:08

    i don't know what types of data accessing technology you are using. i know you can write interceptor or event listener to do the security checking for hibernate. i think ibatis is also the same way. in my project, i wrote CRUD enable interface methods in the parent model/entity class, and doing security check in some events, such as before entity loading. spring security acl is a bit complex. implementing your security solution is more better.

提交回复
热议问题