mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Fixed #4596 - manufacturer gate
This commit is contained in:
parent
035f7a5292
commit
defed52caa
13
app/Policies/ManufacturerPolicy.php
Normal file
13
app/Policies/ManufacturerPolicy.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Policies\SnipePermissionsPolicy;
|
||||
|
||||
class ManufacturerPolicy extends SnipePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'manufacturers';
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ use App\Models\License;
|
|||
use App\Models\Location;
|
||||
use App\Models\Statuslabel;
|
||||
use App\Models\Supplier;
|
||||
use App\Models\Manufacturer;
|
||||
use App\Models\User;
|
||||
use App\Policies\AccessoryPolicy;
|
||||
use App\Policies\AssetModelPolicy;
|
||||
|
@ -28,6 +29,7 @@ use App\Policies\LocationPolicy;
|
|||
use App\Policies\StatuslabelPolicy;
|
||||
use App\Policies\SupplierPolicy;
|
||||
use App\Policies\UserPolicy;
|
||||
use App\Policies\ManufacturerPolicy;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
@ -38,6 +40,8 @@ class AuthServiceProvider extends ServiceProvider
|
|||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* See SnipePermissionsPolicy for additional information.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
|
@ -54,6 +58,7 @@ class AuthServiceProvider extends ServiceProvider
|
|||
Statuslabel::class => StatuslabelPolicy::class,
|
||||
Supplier::class => SupplierPolicy::class,
|
||||
User::class => UserPolicy::class,
|
||||
Manufacturer::class => ManufacturerPolicy::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -126,6 +131,7 @@ class AuthServiceProvider extends ServiceProvider
|
|||
|| $user->can('view', \App\Models\Department::class)
|
||||
|| $user->can('view', \App\Models\Location::class)
|
||||
|| $user->can('view', \App\Models\Company::class)
|
||||
|| $user->can('view', \App\Models\Manufacturer::class)
|
||||
|| $user->can('view', \App\Models\Depreciation::class);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue