I am creating a role-based access control webapp using Acegi (Spring) security. Therefore, I have different users with roles: ROLE_ADMIN , ROLE_USER , etc.
However, I need to implement various user restrictions.
Consider an example:
Suppose there is a site where users can watch movies online. There are users with the roles ROLE_STANDARD_USER and ROLE_VIP_USER . Standard users can watch 3 films a week, and vip users can watch 10 films a week and have some other privileges. And there is one user in the standard user group to whom I want to provide an additional 2 films per week. The number of permitted films can sometimes vary.
In addition, there are various categories of films: fantasy, comedy, classic, new films, etc. And I want some users, regardless of their role, to have access only to certain categories. Categories can be created and deleted dynamically.
Are there any standard methods for implementing this type of user restriction?
Can / should be done with Spring Security Roles and Permissions?
Or do I need to think about adding a rule-based mechanism to my application?
Thanks.
Edit:
The above example is fictitious, my project is related to providing remote access to various network (and other) equipment for students. However, the types of user restrictions are likely to be the same.
Unfortunately, the Model for user access and restrictions is not complete and stable. In the near future, I may need to implement various additional restrictions for users who are not yet known.
Therefore, I would like to choose a path that will facilitate the addition or change of new user restrictions in the future and will not require a significant revision of the internal model or database structure. If at all possible.
Edit 2
Currently, the main user restrictions are hard-coded (left over from the prototyping system). I assume that first I will try to reformat it first to some parameterized business service objects, and then think about where I can go from there. I will also consider using Spring Security Authorization Solution Managers.
Thanks for all the suggestions!
source share