Answer the question
In order to leave comments, you need to log in
Laravel app with user accounts and permissions?
Hello!
An application is conceived where:
1. When registering a user, a name is specified that is unique in the application, for example 'qwerty'
2. Based on this name, an account is created, the owner of which is this user. Access to the account on the subdomain 'qwerty.myapp.com'.
3. It is assumed that the user can give access to his account to other users, while it is required to grant permissions for certain actions in the account.
Question: how to organize it (architecturally or something) correctly?
I know about rbac, about packages that implement rbac in laravel, but the picture in my head does not add up.
Please point me in the right direction, I'd be very grateful.
And if someone takes the time to write a little more, I will be very, very grateful :))
Answer the question
In order to leave comments, you need to log in
We divide the task into stages:
1. When registering a user, a name is specified that is unique in the application, for example 'qwerty'
2. Based on this name, an account is created, the owner of which is this user. Access to the account on the subdomain 'qwerty.myapp.com'.
We connect the standard registration, during registration we check the uniqueness of the login with the validator. subdomain is done in the routing file just as easily.
We connect the package, for example, laravel-permission, distribute the necessary rights and enjoy life.
Everything you requested is described in the documentation, in principle, this is the most adequate way.
With this description of the task, that's all you will be answered.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question