You've already forked Atomcms-edit
Initial commit
This commit is contained in:
Executable
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class AchievementPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_achievements');
|
||||
}
|
||||
|
||||
public function view()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_achievements');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_achievements');
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_achievements');
|
||||
}
|
||||
}
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Spatie\Activitylog\Models\Activity;
|
||||
|
||||
class ActivityPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return hasHousekeepingPermission('view_activity_logs');
|
||||
}
|
||||
|
||||
public function view(User $user, Activity $activity): bool
|
||||
{
|
||||
return hasHousekeepingPermission('view_activity_logs');
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function update(User $user, Activity $activity): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function delete(User $user, Activity $activity): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function restore(User $user, Activity $activity): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function forceDelete(User $user, Activity $activity): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Auth\Access\Response;
|
||||
|
||||
class BanPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_bans');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function delete(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_bans');
|
||||
}
|
||||
}
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class CameraPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_camera_web');
|
||||
}
|
||||
|
||||
public function view(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_camera_web');
|
||||
}
|
||||
|
||||
public function create(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_camera_web');
|
||||
}
|
||||
|
||||
public function update(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_camera_web');
|
||||
}
|
||||
}
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class CatalogPagePolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_catalog_pages');
|
||||
}
|
||||
|
||||
public function view(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_catalog_pages');
|
||||
}
|
||||
|
||||
public function create(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_catalog_pages');
|
||||
}
|
||||
|
||||
public function update(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_catalog_pages');
|
||||
}
|
||||
|
||||
public function delete(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('delete_catalog_pages');
|
||||
}
|
||||
}
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class ChatlogPrivatePolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_private_chatlogs');
|
||||
}
|
||||
}
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class ChatlogRoomPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_room_chatlogs');
|
||||
}
|
||||
}
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class CommandLogPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_commandlogs');
|
||||
}
|
||||
}
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class EmulatorSettingPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_emulator_settings');
|
||||
}
|
||||
|
||||
public function view()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_emulator_settings');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_emulator_settings');
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_emulator_settings');
|
||||
}
|
||||
}
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class EmulatorTextPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_emulator_texts');
|
||||
}
|
||||
|
||||
public function view()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_emulator_texts');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_emulator_texts');
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
return hasHousekeepingPermission('manage_emulator_texts');
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class HousekeepingPermissionPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_housekeeping_permissions');
|
||||
}
|
||||
|
||||
public function view(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_housekeeping_permissions');
|
||||
}
|
||||
|
||||
public function create(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_housekeeping_permissions');
|
||||
}
|
||||
|
||||
public function update(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_housekeeping_permissions');
|
||||
}
|
||||
}
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Auth\Access\Response;
|
||||
|
||||
class PermissionPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_permissions');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function view(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_permissions');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function create(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_permissions');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function update(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_permissions');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function delete(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('delete_permissions');
|
||||
}
|
||||
}
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\RadioApplication;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class RadioApplicationPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_radio_applications');
|
||||
}
|
||||
|
||||
public function view(User $user, RadioApplication $radioApplication): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_radio_applications');
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_radio_applications');
|
||||
}
|
||||
|
||||
public function update(User $user, RadioApplication $radioApplication): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_radio_applications');
|
||||
}
|
||||
|
||||
public function delete(User $user, RadioApplication $radioApplication): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_radio_applications');
|
||||
}
|
||||
|
||||
public function restore(User $user, RadioApplication $radioApplication): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_radio_applications');
|
||||
}
|
||||
|
||||
public function forceDelete(User $user, RadioApplication $radioApplication): bool
|
||||
{
|
||||
return hasHousekeepingPermission('manage_radio_applications');
|
||||
}
|
||||
}
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Auth\Access\Response;
|
||||
|
||||
class TagPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_tags');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function view(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_tags');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function create(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_tags');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function update(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_tags');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function delete(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_tags');
|
||||
}
|
||||
}
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Auth\Access\Response;
|
||||
|
||||
class UserPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('edit_user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function view(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('edit_user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function update(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('edit_user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function delete(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('delete_user');
|
||||
}
|
||||
}
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class WebsiteArticlePolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('write_article');
|
||||
}
|
||||
|
||||
public function view(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('write_article');
|
||||
}
|
||||
|
||||
public function create(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('write_article');
|
||||
}
|
||||
|
||||
public function update(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('edit_article');
|
||||
}
|
||||
|
||||
public function delete(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('delete_article');
|
||||
}
|
||||
}
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class WebsiteSettingPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_website_settings');
|
||||
}
|
||||
|
||||
public function view(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_website_settings');
|
||||
}
|
||||
|
||||
public function create(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_website_settings');
|
||||
}
|
||||
|
||||
public function update(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_website_settings');
|
||||
}
|
||||
|
||||
public function delete(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('delete_website_settings');
|
||||
}
|
||||
}
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Auth\Access\Response;
|
||||
|
||||
class WebsiteTeamPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_teams');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function view(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_teams');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function create(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_teams');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function update(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_teams');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function delete(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_teams');
|
||||
}
|
||||
}
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Wordfilter;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Auth\Access\Response;
|
||||
|
||||
class WordfilterPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_wordfilter');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function view(User $user, Wordfilter $wordfilter)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_wordfilter');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function create(User $user)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_wordfilter');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function update(User $user, Wordfilter $wordfilter)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_wordfilter');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*
|
||||
* @return Response|bool
|
||||
*/
|
||||
public function delete(User $user, Wordfilter $wordfilter)
|
||||
{
|
||||
return hasHousekeepingPermission('manage_wordfilter');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user