I am creating a REST service in Java using Dropwizard in combination with Apache Shiro for authentication and authorization. I extended JdbcRealm in order to make Shiro use my PostgreSQL database (which I access through Hibernate). Authentication works well. Creating group-level permissions is also very easy. Unfortunately, I was not able to find an idiomatic way to bind certain resource instances to specific users (subjects). I know that Shiro provides support for instance-level access control, but the documentation does not show a workflow which allows me to do the following:
- User Alice creates resource X
- User Bob should be allowed to read X, but not to write/delete it
- User Alice should have full read/write/delete access to X
Any hints or recommendations are appreciated!