Skip to content
Permalink
Browse files

Fix updating of permissions

  • Loading branch information...
mikebronner committed May 20, 2019
1 parent 2832a62 commit 32423b669d26c884684c9f121092fd187c2cec40

Some generated files are not rendered by default. Learn more.

@@ -20,10 +20,10 @@ public function run()
foreach ($entities as $entity) {
foreach ($actions as $action) {
(new $permissionClass)->firstOrCreate([
"role_key" => $superadmin->name,
"action_key" => $action->name,
"ownership_key" => $ownership->name,
"entity_key" => $entity->name,
"role_name" => $superadmin->name,
"action_name" => $action->name,
"ownership_name" => $ownership->name,
"entity_name" => $entity->name,
]);
}
}
@@ -9,16 +9,16 @@ public function run()
if (Schema::hasTable('permissions')) {
app("db")
->table("permissions")
->where("role_key", "NOT LIKE", "SuperAdmin")
->where("role_name", "NOT LIKE", "SuperAdmin")
->get()
->each(function ($permission) {
app("db")
->table("governor_permissions")
->insert([
"role_name" => $permission->role_key,
"action_name" => $permission->action_key,
"entity_name" => $permission->entity_key,
"ownership_name" => $permission->ownership_key,
"role_name" => $permission->role_name,
"action_name" => $permission->action_name,
"entity_name" => $permission->entity_name,
"ownership_name" => $permission->ownership_name,
]);
});
}
@@ -31,7 +31,7 @@ public function run()
app("db")
->table("governor_role_user")
->insert([
"role_name" => $roleUser->role_key,
"role_name" => $roleUser->role_name,
"user_id" => $roleUser->user_id,
]);
});

0 comments on commit 32423b6

Please sign in to comment.
You can’t perform that action at this time.