1
0
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:
Hillel Coren 2016-05-08 09:27:32 +03:00
commit c604ac5210
8 changed files with 66 additions and 1 deletions

View 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');
}
}

View 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');
}
}

View 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');
}
}

View File

@ -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');
}
}

View File

@ -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');
}
}

View 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');
}
}

View File

@ -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.
*

View File

@ -3,6 +3,7 @@
use Auth;
use Illuminate\Foundation\Bus\DispatchesJobs;
use App\Services\DatatableService;
use Auth;
class BaseService
{