Web application, which uses Maven, JPA and Spring. It comes with an embedded H2 database and the Maven Jetty plugin configured.
To start the application use command line specified below:
mvn jetty:run
To access it type in a browser http://localhost:8080/datapine-test-app.
There are few roles and test users which are initialized during the start of the application:
ROLE_ADMIN
can see list of users, every user details, all items, add or remove items- [email protected] / admin
ROLE_USER
can see list of users, see own items and add new items- [email protected] / aa
- [email protected] / bb
- [email protected] / cc
ROLE_GUEST
can see the welcome page only- [email protected] / guest
When a user is registered, create domain object as it is.
When an item is added, create domain object as well as an Acl entry for item domain.
When item object is requested via find*
methods filter out non authorized items.
//item object must linked to user domain.(acl_sid table has User.id as sid)
- Implement the
UserDAO
using JPA. - Implement the
UserService
using theUserDAO
and transactions. - Implement a RESTful
UserController
to manage users. - Implement a simple user login dialog to login a user. Use
HttpSession
to store the user credentials to save time, Spring Security can also be used. - Use Spring AOP to log all login attempts via console output or log4j.
- Implement and secure via spring security
ItemDAO
andItem
.