feat: Add ContentRecap, Cooperation, IssueManagement, Journalist, MediaMonitoring, News, and Announcement policies.
This commit is contained in:
parent
c7a72a169e
commit
aa77c1c940
69
app/Policies/AnnouncementPolicy.php
Normal file
69
app/Policies/AnnouncementPolicy.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Announcement;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
|
||||
class AnnouncementPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Announcement');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Announcement $announcement): bool
|
||||
{
|
||||
return $authUser->can('View:Announcement');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Announcement');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Announcement $announcement): bool
|
||||
{
|
||||
return $authUser->can('Update:Announcement');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Announcement $announcement): bool
|
||||
{
|
||||
return $authUser->can('Delete:Announcement');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Announcement $announcement): bool
|
||||
{
|
||||
return $authUser->can('Restore:Announcement');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Announcement $announcement): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Announcement');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Announcement');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Announcement');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Announcement $announcement): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Announcement');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Announcement');
|
||||
}
|
||||
}
|
||||
69
app/Policies/ContentRecapPolicy.php
Normal file
69
app/Policies/ContentRecapPolicy.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\ContentRecap;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
|
||||
class ContentRecapPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:ContentRecap');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, ContentRecap $contentRecap): bool
|
||||
{
|
||||
return $authUser->can('View:ContentRecap');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:ContentRecap');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, ContentRecap $contentRecap): bool
|
||||
{
|
||||
return $authUser->can('Update:ContentRecap');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, ContentRecap $contentRecap): bool
|
||||
{
|
||||
return $authUser->can('Delete:ContentRecap');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, ContentRecap $contentRecap): bool
|
||||
{
|
||||
return $authUser->can('Restore:ContentRecap');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, ContentRecap $contentRecap): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:ContentRecap');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:ContentRecap');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:ContentRecap');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, ContentRecap $contentRecap): bool
|
||||
{
|
||||
return $authUser->can('Replicate:ContentRecap');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:ContentRecap');
|
||||
}
|
||||
}
|
||||
69
app/Policies/CooperationPolicy.php
Normal file
69
app/Policies/CooperationPolicy.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Cooperation;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
|
||||
class CooperationPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Cooperation');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Cooperation $cooperation): bool
|
||||
{
|
||||
return $authUser->can('View:Cooperation');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Cooperation');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Cooperation $cooperation): bool
|
||||
{
|
||||
return $authUser->can('Update:Cooperation');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Cooperation $cooperation): bool
|
||||
{
|
||||
return $authUser->can('Delete:Cooperation');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Cooperation $cooperation): bool
|
||||
{
|
||||
return $authUser->can('Restore:Cooperation');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Cooperation $cooperation): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Cooperation');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Cooperation');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Cooperation');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Cooperation $cooperation): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Cooperation');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Cooperation');
|
||||
}
|
||||
}
|
||||
69
app/Policies/IssueManagementPolicy.php
Normal file
69
app/Policies/IssueManagementPolicy.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\IssueManagement;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
|
||||
class IssueManagementPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:IssueManagement');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, IssueManagement $issueManagement): bool
|
||||
{
|
||||
return $authUser->can('View:IssueManagement');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:IssueManagement');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, IssueManagement $issueManagement): bool
|
||||
{
|
||||
return $authUser->can('Update:IssueManagement');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, IssueManagement $issueManagement): bool
|
||||
{
|
||||
return $authUser->can('Delete:IssueManagement');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, IssueManagement $issueManagement): bool
|
||||
{
|
||||
return $authUser->can('Restore:IssueManagement');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, IssueManagement $issueManagement): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:IssueManagement');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:IssueManagement');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:IssueManagement');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, IssueManagement $issueManagement): bool
|
||||
{
|
||||
return $authUser->can('Replicate:IssueManagement');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:IssueManagement');
|
||||
}
|
||||
}
|
||||
69
app/Policies/JournalistPolicy.php
Normal file
69
app/Policies/JournalistPolicy.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Journalist;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
|
||||
class JournalistPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Journalist');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Journalist $journalist): bool
|
||||
{
|
||||
return $authUser->can('View:Journalist');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Journalist');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Journalist $journalist): bool
|
||||
{
|
||||
return $authUser->can('Update:Journalist');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Journalist $journalist): bool
|
||||
{
|
||||
return $authUser->can('Delete:Journalist');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Journalist $journalist): bool
|
||||
{
|
||||
return $authUser->can('Restore:Journalist');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Journalist $journalist): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Journalist');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Journalist');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Journalist');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Journalist $journalist): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Journalist');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Journalist');
|
||||
}
|
||||
}
|
||||
69
app/Policies/MediaMonitoringPolicy.php
Normal file
69
app/Policies/MediaMonitoringPolicy.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\MediaMonitoring;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
|
||||
class MediaMonitoringPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, MediaMonitoring $mediaMonitoring): bool
|
||||
{
|
||||
return $authUser->can('View:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, MediaMonitoring $mediaMonitoring): bool
|
||||
{
|
||||
return $authUser->can('Update:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, MediaMonitoring $mediaMonitoring): bool
|
||||
{
|
||||
return $authUser->can('Delete:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, MediaMonitoring $mediaMonitoring): bool
|
||||
{
|
||||
return $authUser->can('Restore:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, MediaMonitoring $mediaMonitoring): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, MediaMonitoring $mediaMonitoring): bool
|
||||
{
|
||||
return $authUser->can('Replicate:MediaMonitoring');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:MediaMonitoring');
|
||||
}
|
||||
}
|
||||
69
app/Policies/NewsPolicy.php
Normal file
69
app/Policies/NewsPolicy.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\News;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
|
||||
class NewsPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:News');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, News $news): bool
|
||||
{
|
||||
return $authUser->can('View:News');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:News');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, News $news): bool
|
||||
{
|
||||
return $authUser->can('Update:News');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, News $news): bool
|
||||
{
|
||||
return $authUser->can('Delete:News');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, News $news): bool
|
||||
{
|
||||
return $authUser->can('Restore:News');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, News $news): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:News');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:News');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:News');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, News $news): bool
|
||||
{
|
||||
return $authUser->can('Replicate:News');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:News');
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user