2019-05-03 09:57:55 +02:00
|
|
|
<?php
|
2019-05-11 05:32:07 +02:00
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
2019-05-03 09:57:55 +02:00
|
|
|
|
|
|
|
namespace App\Policies;
|
|
|
|
|
|
|
|
use App\Models\Payment;
|
|
|
|
use App\Models\User;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class PaymentPolicy
|
|
|
|
* @package App\Policies
|
|
|
|
*/
|
|
|
|
class PaymentPolicy extends EntityPolicy
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Checks if the user has create permissions
|
|
|
|
*
|
|
|
|
* @param User $user
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function create(User $user) : bool
|
|
|
|
{
|
2019-11-12 12:36:24 +01:00
|
|
|
return $user->isAdmin() || $user->hasPermission('create_payment') || $user->hasPermission('create_all');
|
2019-05-03 09:57:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|