Skip to content

Commit

Permalink
fix forgot panels permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Lloric Mayuga Garcia <[email protected]>
  • Loading branch information
lloricode committed Aug 25, 2024
1 parent 632f8b9 commit f5bec91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Enums/PermissionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
enum PermissionType: string
{
case resources = 'resources';
case panels = 'panels';
case pages = 'pages';
case widgets = 'widgets';
case customs = 'customs';
case panels = 'panels';
}
10 changes: 10 additions & 0 deletions src/Resources/RoleResource/Schema/PermissionSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ function (Get $get): array {
return $return;
}),
]),
Forms\Components\Tabs\Tab::make(trans('Panels'))
->schema(function () {
$return = [];

foreach (PermissionCollection::groupByTypeThenParent(self::$guardName)[PermissionType::panels->value] ?? [] as $parentPermission => $permissionsDatas) {
$return[] = self::abilities($permissionsDatas, $parentPermission);
}

return $return;
}),
Forms\Components\Tabs\Tab::make(trans('Pages'))
->schema(function () {
$return = [];
Expand Down

0 comments on commit f5bec91

Please sign in to comment.