feat(auth): implement permission-based access for scanner functionality and update related tests
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Domains\Auth\Services;
|
||||
|
||||
use App\Domains\Auth\Models\User;
|
||||
use App\Domains\Authorization\Enums\RoleCode;
|
||||
|
||||
class ScannerContextService
|
||||
{
|
||||
@@ -13,7 +12,7 @@ class ScannerContextService
|
||||
->with([
|
||||
'menues' => fn ($query) => $query->whereHas(
|
||||
'roles',
|
||||
fn ($query) => $query->where('codigo', RoleCode::Scanner->value)
|
||||
fn ($query) => $query->where('codigo', $user->rol_codigo)
|
||||
),
|
||||
])
|
||||
->firstOrFail();
|
||||
|
||||
Reference in New Issue
Block a user