2019-05-02 13:07:38 +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-02 13:07:38 +02:00
|
|
|
|
|
|
|
namespace App\Policies;
|
|
|
|
|
|
|
|
use App\Models\Quote;
|
|
|
|
use App\Models\User;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class QuotePolicy
|
|
|
|
* @package App\Policies
|
|
|
|
*/
|
|
|
|
class QuotePolicy 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_quote') || $user->hasPermission('create_all');
|
2019-05-02 13:07:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|