Delegation App demonstrates the scenarios where a home owner lists their property for rent, and delegates view access to another user. It is based on OACC http://oaccframework.org/ and it closely follows the ideas and the implementations behind secure-todo-example http://oaccframework.org/secure-todo-example.html.
There are a few specific differences from the secure-todo application
- It uses Liquibase scripts to build the initial tables required for OACC and application domain
- It then programatically initializes OACC database and builds the OACC domain specific resources and permissions
- The context is a property management domain, rather than a to-do application
- It has a postman suite to run integration tests
The application starts by creating a hsql in-memory database instance for oacc and application domains. It then runs a series of SQL scripts using Liquibase to create the initial set of tables and users.
After the database setup, it runs OACC initialization code, and creates a series of domain specific resource classes, permissions on those resource classes, and new resources owner-role and owner-role-helper.
Operations:
POST /users/: Create new user. Creates a new user and assigns the user to owner role, with access to create properties.POST /properties/: Create a new property. Needs basic authentication in the header to create a property. The user who creates the property has VIEW, EDIT and DELETE permissions. The user also has the permission to grant view access to another user for a specific propertyGET /properties/: Gets all properties which the authenticated user has access toGET /properties/{id}: Get the property details corresponding toid. ReturnsUNAUTHORIZEDif the authenticated user does not have permissions to view the propertyPUT /properties/{id}?share_with={email_address}: Grant view access to the property with identifieridto another user
The postman folder has postman tests to run through some scenarios.
- Run
mvn clean installto build your application - Start application with
java -jar target/oacc-delegation-1.0-SNAPSHOT.jar server oacc-delegation-config.yml - To check that your application is running enter url
http://localhost:8080
To see your applications health enter url http://localhost:8081/healthcheck