Myth Auth - Working with groups and permissions |
Any documentation on how to deploy groups and permissions using myth?
I inserted this data into the auth_groups table: ID | Name | Description 1 | Admin | Admin 2 | Member | Member auth_groups_users group_id | user_id 1 | 1 2| 2 auth_groups_permissions group_id | permission_id 1 | 1 auth_permissions id | name | description 1| admin | admin I have two users: 1 = Admin 2 = Member Routes: PHP Code: $routes->group('/', ['filter' => 'login'], function($routes){ but the administrator when accessing the route users says he doesn't have permission
auth_helper
PHP Code: has_permission($permission) What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I found this inside the repository
https://github.com/lonnieezell/myth-auth...ization.md What I understood so far is: role=group permission=group permission
It has premission for user tooo
You can use rule base or prmission yatem to access Look at filters you ll see
Enlightenment Is Freedom
I've looked at the filters but it seems to only work with groups not users.
PHP Code: $authorize = service('authorization'); I didn't find anything specific to work with users, but in the database there is a table called "auth_users_permissions" I will keep doing some tests
for role, you need to set role in auth_groups, then add user to auth_group_users
auth_groups 1 | admin 2 | member auth_group_users group_id | user_id 1 | 1 2 | 2 this 2, enough for setting role in filter for permission, set permission in auth_permissions , then add user to auth_user_permissions (for user) or auth_groups_permissions (for group) (06-23-2021, 11:00 PM)paliz Wrote: Are sure i tested it work for user permissions too which version did you use?, i am using release 1 ikesela Wrote:...then add user to auth_user_permissions (for user)... So am I required to declare a group and give permissions to it and then to the user? I wanted it to be user-only without having to put him in a group. (06-24-2021, 06:40 AM)rafinhaa Wrote: So am I required to declare a group and give permissions to it and then to the user?Myth Auth operates with many concepts such groups (roles) and permissions. User may belong to some single group or groups. Groups = Roles. After registration process if $defaultUserGroup variable in config file is empty (no default group), then user will not belong to any group. To work with permissions you need create them first and set some to the user. Then you can call methods to check user has permission and do some logic. |
Welcome Guest, Not a member yet? Register Sign In |