You've already forked Atomcms-edit
Initial commit
This commit is contained in:
Executable
+74
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Miscellaneous\WebsitePermission;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class WebsitePermissionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$permissions = [
|
||||
[
|
||||
'permission' => 'bypass_vpn',
|
||||
'min_rank' => 6,
|
||||
'description' => 'Min rank to bypass vpn blocker check',
|
||||
],
|
||||
[
|
||||
'permission' => 'view_server_logs',
|
||||
'min_rank' => 7,
|
||||
'description' => 'Minimum required rank to access the log viewer',
|
||||
],
|
||||
[
|
||||
'permission' => 'housekeeping_access',
|
||||
'min_rank' => 7,
|
||||
'description' => 'Minimum required rank to access the housekeeping panel',
|
||||
],
|
||||
[
|
||||
'permission' => 'delete_article_comments',
|
||||
'min_rank' => 7,
|
||||
'description' => 'Minimum required rank to delete article comments without being the author',
|
||||
],
|
||||
[
|
||||
'permission' => 'manage_website_tickets',
|
||||
'min_rank' => 7,
|
||||
'description' => 'Minimum required rank to view and reply to others tickets',
|
||||
],
|
||||
[
|
||||
'permission' => 'delete_website_tickets',
|
||||
'min_rank' => 7,
|
||||
'description' => 'Minimum required rank to delete others tickets',
|
||||
],
|
||||
[
|
||||
'permission' => 'delete_website_ticket_replies',
|
||||
'min_rank' => 7,
|
||||
'description' => 'Minimum required rank to delete replies on a ticket',
|
||||
],
|
||||
[
|
||||
'permission' => 'generate_logo',
|
||||
'min_rank' => 7,
|
||||
'description' => 'Minimum required rank to use the logo generator',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($permissions as $permission) {
|
||||
// firstOrCreate voorkomt dubbele records
|
||||
WebsitePermission::firstOrCreate(
|
||||
['permission' => $permission['permission']],
|
||||
$permission,
|
||||
);
|
||||
}
|
||||
|
||||
// EPIC WEB CONTROL: Reset de cache zodat de PermissionsService de nieuwe data ziet
|
||||
Cache::forget('website_permissions');
|
||||
|
||||
$this->command->info('Website permissions geseedi en cache ververst!');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user