2019-04-15 02:10:54 +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-04-15 02:10:54 +02:00
|
|
|
|
|
|
|
namespace App\Policies;
|
|
|
|
|
|
|
|
use App\Models\Invoice;
|
|
|
|
use App\Models\User;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class InvoicePolicy
|
|
|
|
* @package App\Policies
|
|
|
|
*/
|
|
|
|
class InvoicePolicy extends EntityPolicy
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Checks if the user has create permissions
|
|
|
|
*
|
|
|
|
* @param User $user
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function create(User $user) : bool
|
|
|
|
{
|
|
|
|
return $user->isAdmin() || $user->hasPermission('create_invoice');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|