I've some RESTful services, implemented with Spring MVC, exposing a set of resources. I already use authentication, based on HTTPBasicAuthentication and HTTPS. Some of the resources must be accessible only to some users.
For example, I want that all sub-resources in the URI /users/{userid}/photos
are accessible only to the user userid
. Actually in my application they are accessible to all authenticated users. How can I protect them from other users except userid
?
And what if I want to allow access to this resources only to a subset of users (like, for example, userid
's friends)?