spring mvc - Simplest way to limit user's ability to modify fields in a domain object? -
in restful spring mvc app, efficient way limit user's ability update domain objects?
imagine movie service following url: "service/movie/id". there 2 groups of users, admins , basic users.
while admins can use put request update properties of movie dto, basic users may update subset of them.
what best way implement spring security?
i have considered having separate urls admins , basic users, seems inelegant.
you can use @preauthorize
annotation checking roles. check out if it's need.
http://static.springsource.org/spring-security/site/docs/3.0.x/reference/el-access.html#el-pre-post-annotations
update
can use @preauthorize("hasrole('role_user','role_admin')")
multiple roles.
Comments
Post a Comment