How to create ACL with External Database in Laravel?

Asked

Viewed 108 times

-3

The application I’m making already has a database with the users' data. The levels I need are a 'Common User', a 'Manager' and an 'Admin'. The logic of having a user table, role, role_user, Permissions and permissions_roles, would not work, because there would be no way to create a role_user table, because the goal is for the user data to be managed in only database, which I only have one access view. And I also have to change the logic of login, there is no way to use attemp, because the passwords of the users have a different encryption than Laravel, and I can’t change this in DB.

I thought of creating three Guards and at the time of authentication, according to the logic defined for each user, returns the corresponding Guard and work with it in the application. type if user is manager of any sector, then Return Auth::Guard('manager')->loginUsingId($user->id).

I only believe that this is not the best way, so how to create an Acl with external database in the Library?

1 answer

0


Does a root controller and directs the logged in user to it and makes the default ACL creating the tables as ACL uses, will work perfectly, just need to check if the database user can create tables.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.