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

(This post was last modified: 04-21-2023, 02:00 PM by datamweb.)

Using matrix is useful for checking access permissions with method can().

So if the user is in group superadmin and the permission is not registered in table
auth_permissions_users for it.

And you have AuthGroups.php settings as follows.
PHP Code:
    
public array $matrix = [
        'superadmin' => [
            'admin.access',
        ],
]; 

You will get output yes. Even though the user is not registered for permissions(admin.access).
PHP Code:
    
        
if ($user->can('admin.access')) {
            echo 'yes!!';
        



At least that's my impression. And I don't know anything more than that.
Reply


Messages In This Thread
RE: Shield getPermissions returns an empty array - by datamweb - 04-21-2023, 02:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB