You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "there is no role with ID x" error is thrown by Role::findById(), which is called from getStoredRole(), which is called by collectRoles(), which is called by assignRole().
Your posted assignRole() call looks strange. Why are you passing a nested array?
When reformatting your posted code of: $userOrgManager->assignRole([$roleOrgManager->id => ['organization_id' => $organization->id]]);
it looks like this:
That's not the kind of array that assignRole() accepts. assignRole() accepts a one-dimensional array of role ids or role objects/records or role names.
It should never be looking for a role with an ID of uuid (or org_uuid) ... that's part of the schema, not a valid record id. (If you were giving a role name of uuid, then perhaps "uuid" might be acceptable, but if it gave an error related to such a name, then it would say that it couldn't find a role with that name, not "ID".)
Thus, as parallels999 mentioned, something is wrong in your code or your configuration.
We need to see your complete code related to this. As mentioned, please create a fresh repository for a basic app which recreates this exact problem.
Versions
PHP version: 8.1
Database version: mysql latest
changed migration file:
Enum class:
and Seeder file:
and i got this error - There is no role with ID
org_uuid
for guardapi
already checked .. this role created on the roles table with guard api .
i tried to create roles without organization id but i got same error again.
why i need to fill team_id (it set required and primary in migration file) on the roles table when set teams => true in the permissions.php (config)
The text was updated successfully, but these errors were encountered: