Branch policy

This commit is contained in:
2023-11-30 16:15:30 +05:00
parent 9aa9d03059
commit fbe70ee0b2
2 changed files with 38 additions and 7 deletions

View File

@@ -12,7 +12,11 @@ class BranchPolicy
*/
public function viewAny(User $user): bool
{
//
if ($user->isAdmin()) {
return true;
}
return false;
}
/**
@@ -20,7 +24,11 @@ class BranchPolicy
*/
public function view(User $user, Branch $branch): bool
{
//
if ($user->isAdmin()) {
return true;
}
return false;
}
/**
@@ -28,7 +36,11 @@ class BranchPolicy
*/
public function create(User $user): bool
{
//
if ($user->isAdmin()) {
return true;
}
return false;
}
/**
@@ -36,7 +48,11 @@ class BranchPolicy
*/
public function update(User $user, Branch $branch): bool
{
//
if ($user->isAdmin()) {
return true;
}
return false;
}
/**
@@ -44,7 +60,11 @@ class BranchPolicy
*/
public function delete(User $user, Branch $branch): bool
{
//
if ($user->isAdmin()) {
return true;
}
return false;
}
/**
@@ -52,7 +72,11 @@ class BranchPolicy
*/
public function restore(User $user, Branch $branch): bool
{
//
if ($user->isAdmin()) {
return true;
}
return false;
}
/**
@@ -60,6 +84,10 @@ class BranchPolicy
*/
public function forceDelete(User $user, Branch $branch): bool
{
//
if ($user->isAdmin()) {
return true;
}
return false;
}
}

View File

@@ -3,11 +3,13 @@
namespace App\Providers;
// use Illuminate\Support\Facades\Gate;
use App\Models\Branch\Branch;
use App\Models\Order\Loan\LoanOrder;
use App\Models\Order\Loan\LoanType;
use App\Models\System\Location\Province;
use App\Models\System\Roles\Permission;
use App\Models\System\Roles\Role;
use App\Policies\Branch\BranchPolicy;
use App\Policies\Order\Loan\LoanOrderPolicy;
use App\Policies\Order\Loan\LoanTypePolicy;
use App\Policies\System\Location\ProvincePolicy;
@@ -30,6 +32,7 @@ class AuthServiceProvider extends ServiceProvider
Permission::class => PermissionPolicy::class,
Province::class => ProvincePolicy::class,
Branch::class => BranchPolicy::class,
LoanOrder::class => LoanOrderPolicy::class,
LoanType::class => LoanTypePolicy::class,