Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Refactor abilities seeding
Browse files Browse the repository at this point in the history
  • Loading branch information
Omranic committed Mar 3, 2019
1 parent 77f8da0 commit 3b418f0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions database/seeds/CortexAttributesSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ class CortexAttributesSeeder extends Seeder
*/
public function run()
{
Bouncer::allow('admin')->to('list', config('rinvex.attributes.models.attribute'));
Bouncer::allow('admin')->to('import', config('rinvex.attributes.models.attribute'));
Bouncer::allow('admin')->to('create', config('rinvex.attributes.models.attribute'));
Bouncer::allow('admin')->to('update', config('rinvex.attributes.models.attribute'));
Bouncer::allow('admin')->to('delete', config('rinvex.attributes.models.attribute'));
Bouncer::allow('admin')->to('audit', config('rinvex.attributes.models.attribute'));
$abilities = [
['name' => 'list', 'title' => 'List attributes', 'entity_type' => 'attribute'],
['name' => 'import', 'title' => 'Import attributes', 'entity_type' => 'attribute'],
['name' => 'create', 'title' => 'Create attributes', 'entity_type' => 'attribute'],
['name' => 'update', 'title' => 'Update attributes', 'entity_type' => 'attribute'],
['name' => 'delete', 'title' => 'Delete attributes', 'entity_type' => 'attribute'],
['name' => 'audit', 'title' => 'Audit attributes', 'entity_type' => 'attribute'],
];

collect($abilities)->each(function (array $ability) {
app('cortex.auth.ability')->create($ability);
});
}
}

0 comments on commit 3b418f0

Please sign in to comment.