@@ -16,6 +16,8 @@ class RolesAndPermissionsSeeder extends Seeder
1616
1717 protected Collection $ roles ;
1818
19+ protected Collection $ superAdminPermissions ;
20+
1921 protected Collection $ orgnaisationPermissions ;
2022
2123 protected Collection $ postPermissions ;
@@ -30,13 +32,18 @@ public function run()
3032 protected function createRoles ()
3133 {
3234 $ this ->roles = \collect ([
35+ Role::SUPER_ADMIN ->value => SpatieRole::create (['name ' => Role::SUPER_ADMIN ]),
3336 Role::ADMIN ->value => SpatieRole::create (['name ' => Role::ADMIN ]),
3437 Role::USER ->value => SpatieRole::create (['name ' => Role::USER ]),
3538 ]);
3639 }
3740
3841 protected function createPermissions ()
3942 {
43+ $ this ->superAdminPermissions = \collect ([
44+ SpatiePermission::create (['name ' => Permission::ACCESS_ADMIN ]),
45+ ]);
46+
4047 $ this ->orgnaisationPermissions = \collect ([
4148 SpatiePermission::create (['name ' => Permission::EDIT_ORGANISATION ]),
4249 SpatiePermission::create (['name ' => Permission::UPDATE_ORGANISATION ]),
@@ -53,6 +60,8 @@ protected function createPermissions()
5360
5461 protected function assignPermissionsToRoles ()
5562 {
63+ $ this ->roles ->get (Role::SUPER_ADMIN ->value )->givePermissionTo ($ this ->superAdminPermissions );
64+
5665 $ this ->roles ->get (Role::ADMIN ->value )->givePermissionTo ($ this ->postPermissions );
5766 $ this ->roles ->get (Role::ADMIN ->value )->givePermissionTo ($ this ->orgnaisationPermissions );
5867
0 commit comments