Closed Vincentwiewie closed 2 years ago
Myth-Auth already supports separate admins and user groups. I think the hardest part is setting it up in that you need to code most of it yourself in your controllers. For instance: in my admin controller, I use the restrict() and restrictToGroups() functions to restrict my admin controller to only admins and moderators. You can read the Auth Trait documentation to learn more.
There are tables for setting up different user groups. You can actually setup quite a number of groups. For example for an online store, you can have groups for, general users, wholesalers, vips, customer service reps, managers, developers, distribution, etc... But... you need to create your admin dashboard views to add all the groups and link permissions to groups and users to groups.
auth_group = This is for the group name (admins) and description (Admins). You can restrict controllers/pages to certain groups.
auth_permissions = Permission name (candeleteuser) and description (Can Delete User). You can use this to restrict certain actions to users.
auth_group_permissions = This is a cross-reference table to link permissions to a single user group or multiple groups. like linking a permission for deleting a user to the admin group. group_id = auth_group->id, permission_id = auth_group_permissions->id. With this you can assign a permission to multiple groups and any user in those groups would have that permission.
auth_group_users = this is a cross-reference table to link users to user groups. group_id = auth_groups->id, user_id = users->id.
So far i already Made admin table and Ita work well in register and has grouping , so i Will now go to the Topic , while i make a new table for admin, only can register but cannot login ( when login the myth auth access the user's table not my admin table, so far when i register in new form is saved in new admin table ,but when login the auth aceess the user's not the admin ) , number two is admin now can have a group but cannot filtered access or permission
So far this only i encountered
So i wanna ask is possible for we to extend myth auth like i do
I wanna make 1 function for one group (admin for admin auth, user's for user's auth) and at least peace out 🤣