@extends('shaun_core::admin.layouts.master') @section('content') @include('shaun_core::admin.partial.error')
{{ csrf_field() }} @php // Build the set of slugs whose plugin is currently off (disabled, or // a rare orphan-class state). Used to drop `admin..*` rows seeded // under the core "Manage Site" group when their owning plugin is no // longer active. $pluginRegistry = app(\Packages\ShaunSocial\Plugins\Support\PluginRegistry::class); $unavailablePluginSlugs = $pluginRegistry->getUnavailablePluginSlugs(); @endphp
@foreach($groups as $group) @php $permissions = $group->getPermissions($role)->filter(function ($permission) use ($unavailablePluginSlugs) { // An `admin..` permission keyed to a plugin that is off // is a dead checkbox: its routes / controllers no longer exist, so // toggling it has no effect. Hide the row so the AdminCP role page // mirrors the rest of the disabled-plugin chrome. Other key shapes // (`admin.user.*`, `admin.cache.*`, member-side `.allow_*`) // are unaffected because their second segment doesn't match a // plugin slug. if (! preg_match('/^admin\.([a-z0-9_]+)\./', (string) $permission->key, $matches)) { return true; } return ! in_array($matches[1], $unavailablePluginSlugs, true); })->values(); @endphp {{-- Hide a permission group whose owning plugin is disabled, so the plugin enable/disable stays the single switch (same mechanism as the settings sections). Core groups (no matching plugin) always show. --}} @unless($pluginRegistry->isSettingsPackageDisabled($group->package)) @if ($permissions->count())
{{ __($group->name) }}
@foreach($permissions as $permission) @include('shaun_core::admin.partial.permission.field')
@if ($permission->haveMessagePermission())

{{__("Warning message to user if they don't have this permission")}}: {{$permission->getTranslatedAttributeValue('message_error')}} edit

@endif
@endforeach
@endif @endunless @endforeach
@stop @push('scripts-body') @endpush