2022-05-31 14:06:07 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Policies;
|
|
|
|
|
|
|
|
|
|
use App\Models\User;
|
|
|
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
|
|
|
|
|
2023-08-14 09:23:39 +00:00
|
|
|
class CreditLogPolicy
|
2022-05-31 14:06:07 +02:00
|
|
|
{
|
|
|
|
|
use HandlesAuthorization;
|
|
|
|
|
|
|
|
|
|
/**
|
2023-08-14 09:23:39 +00:00
|
|
|
* Determine if the user can update a given ticket.
|
2022-05-31 14:06:07 +02:00
|
|
|
*
|
2023-08-14 09:23:39 +00:00
|
|
|
* @param \App\Models\User $user
|
|
|
|
|
* @return boolean
|
2022-05-31 14:06:07 +02:00
|
|
|
*/
|
2023-08-14 09:23:39 +00:00
|
|
|
public function update(User $user)
|
2022-05-31 14:06:07 +02:00
|
|
|
{
|
2023-08-14 09:23:39 +00:00
|
|
|
return $user->isAdmin() or $user->brands()->count() > 0;
|
2022-05-31 14:06:07 +02:00
|
|
|
}
|
|
|
|
|
}
|