Coder Social home page Coder Social logo

pydawan / admin-starter-security Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adminfaces/admin-starter-security

0.0 1.0 0.0 3.65 MB

AdminFaces starter project using JavaEE 8 security API

Dockerfile 0.32% Java 39.69% HTML 59.03% CSS 0.97%

admin-starter-security's Introduction

AdminFaces Starter Security

A AdminFaces sample project using JavaEE 8 security API.

Login page

starter1

Car list

starter2

Car form

starter3

Car form responsive

starter4

Authentication

The application has two users configured via Custom IdentityStore, see here.

email/password

[email protected] user has role admin.

[email protected] user has role user.

Authorization

Admin user with role admin can access any page while role user can access only pages under /pages path (only car-list page). See url security constraints.

Users without access to restricted pages (car-form) will be redirected to Access Denied page:

AccessDenied

403

Admin have permissions for all CRUD operations on top of Car entity while common user can only view/list cars.

At page level buttons (like delete) are disabled using following EL:

disabled="#{not externalContext.isUserInRole('ADMIN')"

At method level @RolesAllowed("ADMIN") annotation is used.

Tip
Try using uncommenting finById rolesAllowed on carService here and use find by ID on car-list page with non admin user, it should redirect to Access Denied page.

Running

It should run in any JavaEE 8 application server.

It was tested with WildFly 13.0.0 using ee8-preview mode and Glassfish/Payara 5.

Or using docker:

docker run -it -p 8080:8080 rmpestano/admin-starter-security

The application is available at http://localhost:8080/admin-starter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.