2023-12-05 12:33:25 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Policies;
|
|
|
|
|
|
|
|
|
|
use App\Models\User;
|
|
|
|
|
use App\Policies\Rules\UserStaticRules;
|
|
|
|
|
|
|
|
|
|
class CodePolicy
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Determine whether the user can generate models.
|
|
|
|
|
*
|
|
|
|
|
* @param \App\Models\User $authUser
|
|
|
|
|
* @return boolean
|
|
|
|
|
*/
|
|
|
|
|
public function generate(User $authUser): bool
|
|
|
|
|
{
|
2025-04-18 16:59:57 +02:00
|
|
|
return UserStaticRules::restrictTenant($authUser);
|
2023-12-05 12:33:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Determine whether the user can export models.
|
|
|
|
|
*
|
|
|
|
|
* @param \App\Models\User $authUser
|
|
|
|
|
* @return boolean
|
|
|
|
|
*/
|
|
|
|
|
public function export(User $authUser): bool
|
|
|
|
|
{
|
2025-04-18 16:59:57 +02:00
|
|
|
return UserStaticRules::restrictTenant($authUser);
|
2023-12-05 12:33:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Determine whether the user search models.
|
|
|
|
|
*
|
|
|
|
|
* @param \App\Models\User $authUser
|
|
|
|
|
* @return boolean
|
|
|
|
|
*/
|
|
|
|
|
public function search(User $authUser): bool
|
|
|
|
|
{
|
2025-04-18 16:59:57 +02:00
|
|
|
return UserStaticRules::restrictTenant($authUser);
|
2023-12-05 12:33:25 +01:00
|
|
|
}
|
|
|
|
|
}
|