Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Bug with HasRolesUuid and HasPermissionsUuid #35

@kslimani

Description

@kslimani

There is an issue i missed when i proposed to upgrade laravel-permission to 2.4 : role and permissions are retrieved from database by name but using also guard name. (the logic is in the Spatie Role and Permission findByName methods).

Result is, for example, when using $user->hasRole('role-name'), it request from database by name or uuid, but not guard name : this is an issue when using multiple guards.

I don't know yet how to fix this. (we could add guard name in the where condition in traits, but i dunno if it is the best way as it may be problematic to maintain).

Maybe simply drop support for checking if a user has role or permission by uuid could be a solution for fix this issue ? In fact, is checking a role by uuid instead of name usefull ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions