1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00

Fix for archiving API token

This commit is contained in:
Hillel Coren 2016-08-02 17:39:16 +03:00
parent 128921e512
commit 40836a249b
2 changed files with 6 additions and 4 deletions

View File

@ -2,12 +2,14 @@
namespace App\Policies;
use App\Models\User;
class TokenPolicy extends EntityPolicy {
public static function edit($user, $item) {
public static function edit(User $user, $item) {
return $user->hasPermission('admin');
}
public static function create($user) {
public static function create(User $user) {
return $user->hasPermission('admin');
}
}
}

View File

@ -25,7 +25,7 @@ class AuthServiceProvider extends ServiceProvider
\App\Models\Product::class => \App\Policies\ProductPolicy::class,
\App\Models\TaxRate::class => \App\Policies\TaxRatePolicy::class,
\App\Models\AccountGateway::class => \App\Policies\AccountGatewayPolicy::class,
\App\Models\Token::class => \App\Policies\TokenPolicy::class,
\App\Models\AccountToken::class => \App\Policies\TokenPolicy::class,
\App\Models\BankAccount::class => \App\Policies\BankAccountPolicy::class,
\App\Models\PaymentTerm::class => \App\Policies\PaymentTermPolicy::class,
];