Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple roles/permissions #253

Open
arximughal opened this issue Jun 8, 2023 · 2 comments
Open

Multiple roles/permissions #253

arximughal opened this issue Jun 8, 2023 · 2 comments

Comments

@arximughal
Copy link

How can I implement multiple roles for a single user given the default config in this boilerplate?
e.g., I have a user account with the role user. user role has certain permissions e.g., manageInvoices, getInvoices. But I want one user to have the permission manageOrganization along with the rest of the permissions but I do not want to add manageOrganization permission to all the users who have user role.

Is there any way I can achieve this? Any ideas and suggestions are appreciated!

@akshat-khosya
Copy link

Yuu can create middlewares for the different roles.

@mrFaizanDev
Copy link

As per the flow, You can add one more role e.g.: 'manager'.
Then assign new permission with old one too. /
e.g. manager: [manageInvoices, getInvoices, manageOrganization].
It will make your role more readable that it has these permissions without doing any complex code.
If this is helpful for you then you can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants