Skip to content

Commit

Permalink
permissions updated
Browse files Browse the repository at this point in the history
  • Loading branch information
WilsonKinyua committed Feb 25, 2022
1 parent c1f98ed commit d9950ef
Show file tree
Hide file tree
Showing 143 changed files with 416 additions and 1,285 deletions.
2 changes: 1 addition & 1 deletion database/seeders/EventTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function run()
{
$event = [
[
"event_name" => "Mvp Name",
"event_name" => "WezaSMP Name",
"about" => "
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean non elit nisl. Class aptent
taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Expand Down
8 changes: 4 additions & 4 deletions database/seeders/PermissionRoleTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public function run()
{
$admin_permissions = Permission::all();
Role::findOrFail(1)->permissions()->sync($admin_permissions->pluck('id'));
// $user_permissions = $admin_permissions->filter(function ($permission) {
// return substr($permission->title, 0, 5) != 'user_' && substr($permission->title, 0, 5) != 'role_' && substr($permission->title, 0, 11) != 'permission_';
// });
// Role::findOrFail(2)->permissions()->sync($user_permissions);
$user_permissions = $admin_permissions->filter(function ($permission) {
return substr($permission->title, 0, 5) != 'user_' && substr($permission->title, 0, 5) != 'role_' && substr($permission->title, 0, 11) != 'permission_';
});
Role::findOrFail(2)->permissions()->sync($user_permissions);
}
}
140 changes: 140 additions & 0 deletions database/seeders/PermissionsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,146 @@ public function run()
'id' => 75,
'title' => 'event_schedule_access',
],
[
'id' => 76,
'title' => 'delegate_create',
],
[
'id' => 77,
'title' => 'delegate_edit',
],
[
'id' => 78,
'title' => 'delegate_show',
],
[
'id' => 79,
'title' => 'delegate_delete',
],
[
'id' => 80,
'title' => 'delegate_access',
],
[
'id' => 81,
'title' => 'speaker_create',
],
[
'id' => 82,
'title' => 'speaker_edit',
],
[
'id' => 83,
'title' => 'speaker_show',
],
[
'id' => 84,
'title' => 'speaker_delete',
],
[
'id' => 85,
'title' => 'speaker_access',
],
[
'id' => 86,
'title' => 'sponsor_create',
],
[
'id' => 87,
'title' => 'sponsor_edit',
],
[
'id' => 88,
'title' => 'sponsor_show',
],
[
'id' => 89,
'title' => 'sponsor_delete',
],
[
'id' => 90,
'title' => 'sponsor_access',
],
[
'id' => 91,
'title' => 'guest_of_honor_create',
],
[
'id' => 92,
'title' => 'guest_of_honor_edit',
],
[
'id' => 93,
'title' => 'guest_of_honor_show',
],
[
'id' => 94,
'title' => 'guest_of_honor_delete',
],
[
'id' => 95,
'title' => 'guest_of_honor_access',
],
[
'id' => 96,
'title' => 'exhibitors_create',
],
[
'id' => 97,
'title' => 'exhibitors_edit',
],
[
'id' => 98,
'title' => 'exhibitors_show',
],
[
'id' => 99,
'title' => 'exhibitors_delete',
],
[
'id' => 100,
'title' => 'exhibitors_access',
],
[
'id' => 101,
'title' => 'media_create',
],
[
'id' => 102,
'title' => 'media_edit',
],
[
'id' => 103,
'title' => 'media_show',
],
[
'id' => 104,
'title' => 'media_delete',
],
[
'id' => 105,
'title' => 'media_access',
],
[
'id' => 106,
'title' => 'partner_create',
],
[
'id' => 107,
'title' => 'partner_edit',
],
[
'id' => 108,
'title' => 'partner_show',
],
[
'id' => 109,
'title' => 'partner_delete',
],
[
'id' => 110,
'title' => 'partner_access',
],
];

Permission::insert($permissions);
Expand Down
44 changes: 38 additions & 6 deletions database/seeders/RolesTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,48 @@ public function run()
$roles = [
[
'id' => 1,
'title' => 'Admin',
'title' => 'Super Admin',
],
[
'id' => 2,
'title' => 'User',
"id" => 2,
"title" => "Admin"
],
[
'id' => 3,
'title' => 'Speaker',
],
[
'id' => 4,
'title' => 'Delegate',
],
[
"id" => 3,
"title" => "Speaker"
]
'id' => 5,
'title' => 'Sponsor',
],
[
'id' => 6,
'title' => 'Exhibitors',
],
[
'id' => 7,
'title' => 'Media',
],
[
'id' => 8,
'title' => 'Partners',
],
[
'id' => 9,
'title' => 'Delegate',
],
[
'id' => 10,
'title' => 'Guest of Honour',
],
[
'id' => 11,
'title' => 'User',
],
];

Role::insert($roles);
Expand Down
9 changes: 2 additions & 7 deletions database/seeders/UsersTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@ public function run()
$users = [
[
'id' => 1,
'name' => 'John Doe',
'email' => 'admin@admin.com',
'name' => 'Wilson Kinyua',
'email' => 'admin@wezasmp.com',
'password' => bcrypt('password'),
'remember_token' => null,
'designation' => 'Doctor',
'organisation' => 'Thika',
'state' => 'Kenya',
'city_town' => 'Nairobi',
'website' => '',
],
];

Expand Down
Loading

0 comments on commit d9950ef

Please sign in to comment.