Fix payment form validation, styling and blog header visibility
This commit is contained in:
@@ -11,13 +11,6 @@ use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
class PagePolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function before(AuthUser $user, $ability)
|
||||
{
|
||||
if ($user->hasRole('super_admin')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\ProductCategory;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class ProductCategoryPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:ProductCategory');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, ProductCategory $productCategory): bool
|
||||
{
|
||||
return $authUser->can('View:ProductCategory');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:ProductCategory');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, ProductCategory $productCategory): bool
|
||||
{
|
||||
return $authUser->can('Update:ProductCategory');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, ProductCategory $productCategory): bool
|
||||
{
|
||||
return $authUser->can('Delete:ProductCategory');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, ProductCategory $productCategory): bool
|
||||
{
|
||||
return $authUser->can('Restore:ProductCategory');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, ProductCategory $productCategory): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:ProductCategory');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:ProductCategory');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:ProductCategory');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, ProductCategory $productCategory): bool
|
||||
{
|
||||
return $authUser->can('Replicate:ProductCategory');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:ProductCategory');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Product;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class ProductPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Product');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Product $product): bool
|
||||
{
|
||||
return $authUser->can('View:Product');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Product');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Product $product): bool
|
||||
{
|
||||
return $authUser->can('Update:Product');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Product $product): bool
|
||||
{
|
||||
return $authUser->can('Delete:Product');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Product $product): bool
|
||||
{
|
||||
return $authUser->can('Restore:Product');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Product $product): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Product');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Product');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Product');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Product $product): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Product');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Product');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\SiteTranslation;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class SiteTranslationPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:SiteTranslation');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, SiteTranslation $siteTranslation): bool
|
||||
{
|
||||
return $authUser->can('View:SiteTranslation');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:SiteTranslation');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, SiteTranslation $siteTranslation): bool
|
||||
{
|
||||
return $authUser->can('Update:SiteTranslation');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, SiteTranslation $siteTranslation): bool
|
||||
{
|
||||
return $authUser->can('Delete:SiteTranslation');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, SiteTranslation $siteTranslation): bool
|
||||
{
|
||||
return $authUser->can('Restore:SiteTranslation');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, SiteTranslation $siteTranslation): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:SiteTranslation');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:SiteTranslation');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:SiteTranslation');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, SiteTranslation $siteTranslation): bool
|
||||
{
|
||||
return $authUser->can('Replicate:SiteTranslation');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:SiteTranslation');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user