mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Merge branch 'joshuadwire-laravel-acl' into develop
This commit is contained in:
commit
c604ac5210
13
app/Policies/AccountGatewayPolicy.php
Normal file
13
app/Policies/AccountGatewayPolicy.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
class AccountGatewayPolicy extends EntityPolicy {
|
||||
public static function edit($user, $item) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
|
||||
public static function create($user) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
}
|
13
app/Policies/BankAccountPolicy.php
Normal file
13
app/Policies/BankAccountPolicy.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
class BankAccountPolicy extends EntityPolicy {
|
||||
public static function edit($user, $item) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
|
||||
public static function create($user) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
}
|
13
app/Policies/PaymentTermPolicy.php
Normal file
13
app/Policies/PaymentTermPolicy.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
class PaymentTermPolicy extends EntityPolicy {
|
||||
public static function edit($user, $item) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
|
||||
public static function create($user) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
}
|
@ -6,4 +6,8 @@ class ProductPolicy extends EntityPolicy {
|
||||
public static function edit($user, $item) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
|
||||
public static function create($user) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
}
|
@ -6,4 +6,8 @@ class TaxRatePolicy extends EntityPolicy {
|
||||
public static function edit($user, $item) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
|
||||
public static function create($user) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
}
|
13
app/Policies/TokenPolicy.php
Normal file
13
app/Policies/TokenPolicy.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
class TokenPolicy extends EntityPolicy {
|
||||
public static function edit($user, $item) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
|
||||
public static function create($user) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
}
|
@ -23,8 +23,12 @@ class AuthServiceProvider extends ServiceProvider
|
||||
\App\Models\Vendor::class => \App\Policies\VendorPolicy::class,
|
||||
\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\BankAccount::class => \App\Policies\BankAccountPolicy::class,
|
||||
\App\Models\PaymentTerm::class => \App\Policies\PaymentTermPolicy::class,
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Register any application authentication / authorization services.
|
||||
*
|
||||
|
@ -3,6 +3,7 @@
|
||||
use Auth;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use App\Services\DatatableService;
|
||||
use Auth;
|
||||
|
||||
class BaseService
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user