Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions packages/address/src/Policies/AddressPolicy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

declare(strict_types=1);

namespace Moox\Address\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use Moox\Address\Models\Address;

class AddressPolicy
{
use HandlesAuthorization;

public function viewAny(AuthUser $authUser): bool
{
return $authUser->can('ViewAny:Address');
}

public function view(AuthUser $authUser, Address $address): bool
{
return $authUser->can('View:Address');
}

public function create(AuthUser $authUser): bool
{
return $authUser->can('Create:Address');
}

public function update(AuthUser $authUser, Address $address): bool
{
return $authUser->can('Update:Address');
}

public function delete(AuthUser $authUser, Address $address): bool
{
return $authUser->can('Delete:Address');
}

public function deleteAny(AuthUser $authUser): bool
{
return $authUser->can('DeleteAny:Address');
}

public function restore(AuthUser $authUser, Address $address): bool
{
return $authUser->can('Restore:Address');
}

public function forceDelete(AuthUser $authUser, Address $address): bool
{
return $authUser->can('ForceDelete:Address');
}

public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:Address');
}

public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:Address');
}

public function replicate(AuthUser $authUser, Address $address): bool
{
return $authUser->can('Replicate:Address');
}

public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:Address');
}
}
74 changes: 74 additions & 0 deletions packages/audit/src/Policies/ActivityPolicy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

declare(strict_types=1);

namespace Moox\Audit\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use Moox\Audit\Models\Activity;

class ActivityPolicy
{
use HandlesAuthorization;

public function viewAny(AuthUser $authUser): bool
{
return $authUser->can('ViewAny:Activity');
}

public function view(AuthUser $authUser, Activity $activity): bool
{
return $authUser->can('View:Activity');
}

public function create(AuthUser $authUser): bool
{
return $authUser->can('Create:Activity');
}

public function update(AuthUser $authUser, Activity $activity): bool
{
return $authUser->can('Update:Activity');
}

public function delete(AuthUser $authUser, Activity $activity): bool
{
return $authUser->can('Delete:Activity');
}

public function deleteAny(AuthUser $authUser): bool
{
return $authUser->can('DeleteAny:Activity');
}

public function restore(AuthUser $authUser, Activity $activity): bool
{
return $authUser->can('Restore:Activity');
}

public function forceDelete(AuthUser $authUser, Activity $activity): bool
{
return $authUser->can('ForceDelete:Activity');
}

public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:Activity');
}

public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:Activity');
}

public function replicate(AuthUser $authUser, Activity $activity): bool
{
return $authUser->can('Replicate:Activity');
}

public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:Activity');
}
}
74 changes: 74 additions & 0 deletions packages/builder/src/Policies/FieldGroupPolicy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

declare(strict_types=1);

namespace Moox\Builder\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use Moox\Builder\Models\FieldGroup;

class FieldGroupPolicy
{
use HandlesAuthorization;

public function viewAny(AuthUser $authUser): bool
{
return $authUser->can('ViewAny:FieldGroup');
}

public function view(AuthUser $authUser, FieldGroup $fieldGroup): bool
{
return $authUser->can('View:FieldGroup');
}

public function create(AuthUser $authUser): bool
{
return $authUser->can('Create:FieldGroup');
}

public function update(AuthUser $authUser, FieldGroup $fieldGroup): bool
{
return $authUser->can('Update:FieldGroup');
}

public function delete(AuthUser $authUser, FieldGroup $fieldGroup): bool
{
return $authUser->can('Delete:FieldGroup');
}

public function deleteAny(AuthUser $authUser): bool
{
return $authUser->can('DeleteAny:FieldGroup');
}

public function restore(AuthUser $authUser, FieldGroup $fieldGroup): bool
{
return $authUser->can('Restore:FieldGroup');
}

public function forceDelete(AuthUser $authUser, FieldGroup $fieldGroup): bool
{
return $authUser->can('ForceDelete:FieldGroup');
}

public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:FieldGroup');
}

public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:FieldGroup');
}

public function replicate(AuthUser $authUser, FieldGroup $fieldGroup): bool
{
return $authUser->can('Replicate:FieldGroup');
}

public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:FieldGroup');
}
}
74 changes: 74 additions & 0 deletions packages/category/src/Policies/CategoryPolicy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

declare(strict_types=1);

namespace Moox\Category\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use Moox\Category\Models\Category;

class CategoryPolicy
{
use HandlesAuthorization;

public function viewAny(AuthUser $authUser): bool
{
return $authUser->can('ViewAny:Category');
}

public function view(AuthUser $authUser, Category $category): bool
{
return $authUser->can('View:Category');
}

public function create(AuthUser $authUser): bool
{
return $authUser->can('Create:Category');
}

public function update(AuthUser $authUser, Category $category): bool
{
return $authUser->can('Update:Category');
}

public function delete(AuthUser $authUser, Category $category): bool
{
return $authUser->can('Delete:Category');
}

public function deleteAny(AuthUser $authUser): bool
{
return $authUser->can('DeleteAny:Category');
}

public function restore(AuthUser $authUser, Category $category): bool
{
return $authUser->can('Restore:Category');
}

public function forceDelete(AuthUser $authUser, Category $category): bool
{
return $authUser->can('ForceDelete:Category');
}

public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:Category');
}

public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:Category');
}

public function replicate(AuthUser $authUser, Category $category): bool
{
return $authUser->can('Replicate:Category');
}

public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:Category');
}
}
74 changes: 74 additions & 0 deletions packages/company/src/Policies/CompanyPolicy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

declare(strict_types=1);

namespace Moox\Company\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use Moox\Company\Models\Company;

class CompanyPolicy
{
use HandlesAuthorization;

public function viewAny(AuthUser $authUser): bool
{
return $authUser->can('ViewAny:Company');
}

public function view(AuthUser $authUser, Company $company): bool
{
return $authUser->can('View:Company');
}

public function create(AuthUser $authUser): bool
{
return $authUser->can('Create:Company');
}

public function update(AuthUser $authUser, Company $company): bool
{
return $authUser->can('Update:Company');
}

public function delete(AuthUser $authUser, Company $company): bool
{
return $authUser->can('Delete:Company');
}

public function deleteAny(AuthUser $authUser): bool
{
return $authUser->can('DeleteAny:Company');
}

public function restore(AuthUser $authUser, Company $company): bool
{
return $authUser->can('Restore:Company');
}

public function forceDelete(AuthUser $authUser, Company $company): bool
{
return $authUser->can('ForceDelete:Company');
}

public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:Company');
}

public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:Company');
}

public function replicate(AuthUser $authUser, Company $company): bool
{
return $authUser->can('Replicate:Company');
}

public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:Company');
}
}
Loading
Loading