I'm completely bashing my head against a wall here. Im currently unable to authenticate and its due to failing the user ->canAccessPanel() function.
My use case is I have an Admin Panel, an admin created a role, I can see that role is a team_id set. Then trying to authenticate into Panel B, it fails the check on the role that I've created.
The use case is that Panel B has a whole separate structure and should be able to see content based on the content created in the Admin Panel by matching the tenant.
$this->roles returns empty, but I can query the Role model directly as a test to see the record.
This is where im at so far with the check
protected function canAccessInstructorPanel(): bool
{
// $registrar = app(PermissionRegistrar::class);
$tenantIds = $this->entities()->pluck('id');
foreach ($tenantIds as $tenantId) {
app(PermissionRegistrar::class)->setPermissionsTeamId($tenantId);
if (
$this->hasRole(BaseRolesEnum::INSTRUCTOR->value, 'web') ||
$this->can('access-instructor-panel') ||
$this->checkPermissionTo('Booking.*')
) {
return true;
}
}
return false;
}