Added more permissions to the seeder.

This commit is contained in:
Sebastian Davaris 2020-06-30 08:49:39 +02:00
parent f638777878
commit c609cf78ff
1 changed files with 16 additions and 6 deletions

View File

@ -40,19 +40,29 @@ class PermissionSeeder extends Seeder
"link.external.edit" => "Allows editing of external links.",
"link.external.delete" => "Allows deletion of external links",
"event.create" => "Create a new event",
"event.list" => "Shows all events",
"event.show" => "Shows event",
"event.edit" => "Edit event",
"event.delete" => "Deletes an event",
"contact.create" => "Creates a new contact",
"contact.list" => ""
];
foreach ($permissions as $key => $value) {
// if(Permission::findByName($key))
// continue;
$permission = new Permission();
try {
if(Permission::findByName($key))
continue;
} catch (Exception $e) {
$permission = new Permission();
$permission->name = $key;
$permission->description = $value;
$permission->name = $key;
$permission->description = $value;
$permission->save();
$permission->save();
}
}
}
}