Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Full Stack Development with JHipster

You're reading from   Full Stack Development with JHipster Build modern web applications and microservices with Spring and Angular

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher Packt
ISBN-13 9781788476317
Length 380 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
 Sasidharan Sasidharan
Author Profile Icon Sasidharan
Sasidharan
 Nellaiyapen Nellaiyapen
Author Profile Icon Nellaiyapen
Nellaiyapen
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Title Page
Copyright and Credits
Dedication
Packt Upsell
Foreword
Contributors
Preface
1. Introduction to Modern Web Application Development FREE CHAPTER 2. Getting Started with JHipster 3. Building Monolithic Web Applications with JHipster 4. Entity Modeling with JHipster Domain Language 5. Customization and Further Development 6. Testing and Continuous Integration 7. Going into Production 8. Introduction to Microservice Server-Side Technologies 9. Building Microservices with JHipster 10. Working with Microservices 11. Deploying with Docker Compose 12. Deploying to the Cloud with Kubernetes 13. Using React for the Client-Side 14. Best Practices with JHipster 1. Other Books You May Enjoy Index

Authorization with Spring Security


As you may have noticed, when it comes to generated code, JHipster doesn't provide much in terms of role-based security, authorization management, and so on. This is intentional, as these heavily depend on the use case and most often associated with the business logic of the application. So, it would be better if this was hand-coded by the developers as part of the business code.

Normal users have ROLE_USER and admin users have ROLE_ADMIN assigned in user management. For our use case there are few security holes that we need to take care of: 

  • Normal users should only have access to view the product listing, product order, order item, invoice, and shipment 
  • Normal users should not have access to create/edit/delete entities via the CRUD API
  • Normal users should not be able to access the product order, order item, invoice, and shipment of other users

We could overcome these issues using features provided by Spring Security.

Limiting access to entities

First, let's...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images