Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Shield getPermissions returns an empty array
#2

Permissions vary by Groups.

Your command creates the user with the desired group.
Therefore, you can use the following command to access the user group.

PHP Code:
print_r(auth()->user()->getGroups()); 

If you want to access permissions, you must first add permissions for each user. In this command, you have not added permission for the user, so an empty array is returned.

see https://codeigniter4.github.io/shield/au...permission
Reply


Messages In This Thread
RE: Shield getPermissions returns an empty array - by datamweb - 04-21-2023, 11:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB