1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Policies/CreditPolicy.php
Benjamin Beganović 67c6ac1bc2
Test fixes & code improvements (#3267)
- Updated rules for storing credits
- Fixed route controller
- Added test for crud operations
- Added new $invoice object in MockAccountData
- Added & registered CreditPolicy
2020-01-30 14:02:25 +11:00

17 lines
347 B
PHP

<?php
namespace App\Policies;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
class CreditPolicy extends EntityPolicy
{
use HandlesAuthorization;
public function create(User $user) : bool
{
return $user->isAdmin() || $user->hasPermission('create_quote') || $user->hasPermission('create_all');
}
}