api-server-nodejs icon indicating copy to clipboard operation
api-server-nodejs copied to clipboard

Evolution 3# - Authorization (Roles)

Open app-generator opened this issue 3 years ago • 2 comments

Hello @FullStackkDev

The authorization should link each user to a ROLE:

  • user - numeric value 1 in users table
  • admin - numeric value 2 in users table

On successful signIN (JWT) or OAuth, the API server return also the role of the user

  • during the registration (JWT, OAuth) the created user is associated with a default "USER" role

Thank you!

app-generator avatar Nov 28 '22 10:11 app-generator

Hello @FullStackkDev,

We need a simple mechanism (CLI is preferred) to assign an ADMIN role to an existing user.
Let me know a simple solution for this use case.

Ty!

app-generator avatar Nov 29 '22 17:11 app-generator

@app-generator I have updated the step4 branch for it.

Run update-role command specified in the package.json file to assign the role. I have described briefly in the README file on how to use this command. https://github.com/app-generator/api-server-nodejs/tree/step4/support-for-react#-update-role-for-existing-user

FullStackkDev avatar Nov 30 '22 12:11 FullStackkDev

Hello!

Sorry for the delay. The new AppSeed Service now manages the project and related issues:

https://app-generator.dev/ - Open-Source Platform.

Ty!

app-generator avatar Dec 18 '24 19:12 app-generator