wip
This commit is contained in:
@@ -13,7 +13,11 @@ class LoanOrderPolicy
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,7 +25,11 @@ class LoanOrderPolicy
|
||||
*/
|
||||
public function view(User $user, LoanOrder $loanOrder): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,7 +37,11 @@ class LoanOrderPolicy
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +49,11 @@ class LoanOrderPolicy
|
||||
*/
|
||||
public function update(User $user, LoanOrder $loanOrder): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,7 +61,11 @@ class LoanOrderPolicy
|
||||
*/
|
||||
public function delete(User $user, LoanOrder $loanOrder): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +73,11 @@ class LoanOrderPolicy
|
||||
*/
|
||||
public function restore(User $user, LoanOrder $loanOrder): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,6 +85,10 @@ class LoanOrderPolicy
|
||||
*/
|
||||
public function forceDelete(User $user, LoanOrder $loanOrder): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,11 @@ class LoanTypePolicy
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,7 +25,11 @@ class LoanTypePolicy
|
||||
*/
|
||||
public function view(User $user, LoanType $loanType): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,7 +37,11 @@ class LoanTypePolicy
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +49,11 @@ class LoanTypePolicy
|
||||
*/
|
||||
public function update(User $user, LoanType $loanType): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,7 +61,11 @@ class LoanTypePolicy
|
||||
*/
|
||||
public function delete(User $user, LoanType $loanType): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +73,11 @@ class LoanTypePolicy
|
||||
*/
|
||||
public function restore(User $user, LoanType $loanType): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,6 +85,10 @@ class LoanTypePolicy
|
||||
*/
|
||||
public function forceDelete(User $user, LoanType $loanType): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,11 @@ class ProvincePolicy
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,7 +25,11 @@ class ProvincePolicy
|
||||
*/
|
||||
public function view(User $user, Province $province): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,7 +37,11 @@ class ProvincePolicy
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +49,11 @@ class ProvincePolicy
|
||||
*/
|
||||
public function update(User $user, Province $province): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,7 +61,11 @@ class ProvincePolicy
|
||||
*/
|
||||
public function delete(User $user, Province $province): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +73,11 @@ class ProvincePolicy
|
||||
*/
|
||||
public function restore(User $user, Province $province): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,6 +85,10 @@ class ProvincePolicy
|
||||
*/
|
||||
public function forceDelete(User $user, Province $province): bool
|
||||
{
|
||||
//
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,14 @@
|
||||
namespace App\Providers;
|
||||
|
||||
// use Illuminate\Support\Facades\Gate;
|
||||
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\Order\Loan\LoanOrderPolicy;
|
||||
use App\Policies\Order\Loan\LoanTypePolicy;
|
||||
use App\Policies\System\Location\ProvincePolicy;
|
||||
use App\Policies\System\Roles\PermissionPolicy;
|
||||
use App\Policies\System\Roles\RolePolicy;
|
||||
use App\Policies\UserPolicy;
|
||||
@@ -19,8 +25,14 @@ class AuthServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected $policies = [
|
||||
User::class => UserPolicy::class,
|
||||
|
||||
Role::class => RolePolicy::class,
|
||||
Permission::class => PermissionPolicy::class,
|
||||
|
||||
Province::class => ProvincePolicy::class,
|
||||
|
||||
LoanOrder::class => LoanOrderPolicy::class,
|
||||
LoanType::class => LoanTypePolicy::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@ return new class extends Migration
|
||||
$table->string('real_address');
|
||||
|
||||
$table->string('passport_serie')->index();
|
||||
$table->integer('passport_id')->index();
|
||||
$table->string('passport_id')->index();
|
||||
$table->date('passport_given_at');
|
||||
$table->string('passport_given_by');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user