We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb7b3db commit 8a6b3adCopy full SHA for 8a6b3ad
src/Http/Middleware/ParseCustomPolicyActions.php
@@ -60,10 +60,14 @@ protected function registerCustomPolicyActions(): void
60
->first();
61
62
if (! $permission) {
63
+ $entityClass = config("genealabs-laravel-governor.models.entity");
64
$permissionClass = config("genealabs-laravel-governor.models.permission");
65
+ $entity = (new $entityClass)->firstOrCreate([
66
+ "name" => $action->entity,
67
+ ]);
68
(new $permissionClass)->firstOrCreate([
69
"role_name" => "SuperAdmin",
- "entity_name" => $action->entity,
70
+ "entity_name" => $entity,
71
"action_name" => $action->name,
72
"ownership_name" => "any",
73
]);
0 commit comments