jaxio / celerio-angular-quickstart

Generate an Angular 5 CRUD application from an existing database schema (we provide a sample one)
Apache License 2.0
481 stars 138 forks source link

How to add users with different roles #28

Closed jdanosborne closed 7 years ago

jdanosborne commented 7 years ago

I'm now finding this project is working well for me - thank you!

Do you have any advice on how to configure users with different roles?

For example I might like to have a user with read-only access, one with update only in addition to the existing admin user with full privileges.

TIA

Dan

nromanetti commented 7 years ago

I presume your question is how could we implement this ? You could implement a rest endpoint to get the roles of the currently logged in user. Leverage the readonly attribute on the various component and also hide save buttons... On the server side you should also check whether or not the user has the privilege to save an item before saving it.

jdanosborne commented 7 years ago

OK thanks for the pointers. I'd presumably attempt this in the code generation templates as per your reply on https://github.com/jaxio/celerio-angular-quickstart/issues/29#issuecomment-287915154.

I'll have a look at spring security and give it a go.