Files
ABSDEV/Modules/Roles/Database/Seeders/RolePermissionSeeder.php
T
Mark Gregory bc9427ac33 Deployment environments
* Development, staging, and production environment types
* Protected-environment support
* Deployment targets
* Local, SSH, Docker, and Kubernetes driver foundation
* Deployment pipelines
* Configurable pipeline steps
* Manual and approval-based releases
* Deployment release history
* Individual deployment-step tracking
* HTTP health checks
* Response-time tracking
* Rollback records
* Secret-reference metadata
* Encrypted target configuration
* Encrypted environment variables
* Administration dashboard
* Authenticated API endpoints
* Health-check command
* Release-history pruning command
* Permissions
* Sidebar integration
* Module registration
* Feature test
2026-07-24 13:57:56 +01:00

97 lines
2.8 KiB
PHP

<?php
namespace Modules\Roles\Database\Seeders;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Permission;
use Spatie\Permission\Models\Role;
use Spatie\Permission\PermissionRegistrar;
final class RolePermissionSeeder extends Seeder
{
public function run(): void
{
$registrar = app(PermissionRegistrar::class);
$registrar->forgetCachedPermissions();
$permissions = [
'administration.access',
'users.view',
'users.create',
'users.update',
'users.delete',
'roles.manage',
'settings.manage',
'audit.view',
'media.view',
'media.upload',
'media.update',
'media.delete',
'seo.manage',
'search.manage',
'themes.manage',
'pages.manage',
'menus.manage',
'redirects.manage',
'forms.manage',
'documents.manage',
'banners.manage',
'faq.manage',
'team.manage',
'testimonials.manage',
'blog.manage',
'news.manage',
'categories.manage',
'tags.manage',
'authors.manage',
'comments.moderate',
'crm.manage',
'newsletter.manage',
'events.manage',
'careers.manage',
'locations.manage',
'workflow.view',
'workflow.manage',
'workflow.review',
'localization.manage',
'localization.translate',
'sites.view',
'sites.manage',
'sites.assign',
'developer.access',
'api.view',
'api.manage',
'enterprise.view',
'enterprise.manage',
'commerce.view',
'commerce.manage',
'commerce.orders.manage',
'commerce.products.manage',
'security.view',
'security.manage',
'security.audit',
'automation.view',
'automation.manage',
'automation.execute',
'ai.view',
'ai.manage',
'ai.execute',
'analytics.view',
'analytics.manage',
'analytics.export',
'builder.view', 'builder.manage', 'builder.publish',
'marketplace.view', 'marketplace.install', 'marketplace.update', 'marketplace.remove',
'cloud-devops.view', 'cloud-devops.manage', 'cloud-devops.deploy', 'cloud-devops.rollback',
];
foreach ($permissions as $permission) {
Permission::findOrCreate($permission, 'web');
}
$administrator = Role::findOrCreate('admin', 'web');
$administrator->syncPermissions($permissions);
$registrar->forgetCachedPermissions();
}
}