commit5
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-30 10:55:18 +02:00
parent 0235c7609e
commit 48347e2d3a
161 changed files with 11814 additions and 265 deletions
+13 -1
View File
@@ -3,6 +3,7 @@
namespace App\Models;
use App\Enums\PurchasingRole;
use App\Services\OrganizationAccess;
use Database\Factories\UserFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Hidden;
@@ -15,7 +16,7 @@ use Illuminate\Support\Carbon;
* @property int $id
* @property int|null $tenant_id
* @property int|null $department_id
* @property PurchasingRole $purchasing_role
* @property PurchasingRole|null $purchasing_role
* @property string $name
* @property string $email
* @property Carbon|null $email_verified_at
@@ -31,6 +32,17 @@ use Illuminate\Support\Carbon;
#[Hidden(['password', 'two_factor_secret', 'two_factor_recovery_codes', 'remember_token'])]
class User extends Authenticatable
{
/** @param list<PurchasingRole|string> $functions */
public function hasFunctions(array $functions): bool
{
return app(OrganizationAccess::class)->allows($this, $functions);
}
public function departmentScoped(): bool
{
return app(OrganizationAccess::class)->departmentScoped($this);
}
/** @use HasFactory<UserFactory> */
use HasFactory, Notifiable;