Skip to content

Commit

Permalink
remove news_editor,event_editor roles in boilerplate config
Browse files Browse the repository at this point in the history
  • Loading branch information
IsharaEkanayaka committed Jul 14, 2024
1 parent 0859c81 commit 621c440
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions config/boilerplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
* It is not recommended to change
*/
'admin' => 'Administrator',
'news_editor' => 'News Editor',
'event_editor' => 'Event Editor',
],
],

Expand Down
4 changes: 2 additions & 2 deletions database/seeders/Auth/UserRoleSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function run()
$this->disableForeignKeys();

User::find(1)->assignRole(config('boilerplate.access.role.admin'));
User::find(3)->assignRole(config('boilerplate.access.role.news_editor'));
User::find(4)->assignRole(config('boilerplate.access.role.event_editor'));
User::find(3)->assignRole('News Editor');
User::find(4)->assignRole('Event Editor');

$this->enableForeignKeys();
}
Expand Down
4 changes: 2 additions & 2 deletions resources/views/backend/includes/sidebar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class="c-sidebar-nav-dropdown {{ activeClass(Route::is('admin.auth.user.*') || R
</li>
@endif

@if ($logged_in_user->can('admin.access.news.edit'))
@if ($logged_in_user->hasPermissionTo('admin.access.news.edit'))
{{-- News --}}
<li class="c-sidebar-nav-dropdown">
<x-utils.link href="#" icon="c-sidebar-nav-icon cil-list" class="c-sidebar-nav-dropdown-toggle"
Expand All @@ -99,7 +99,7 @@ class="c-sidebar-nav-dropdown {{ activeClass(Route::is('admin.auth.user.*') || R
</li>
@endif

@if ($logged_in_user->can('admin.access.events.edit'))
@if ($logged_in_user->hasPermissionTo('admin.access.events.edit'))
{{-- Events --}}
<li class="c-sidebar-nav-dropdown">
<x-utils.link href="#" icon="c-sidebar-nav-icon cil-list" class="c-sidebar-nav-dropdown-toggle"
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function loginAsAdmin($admin = false)
protected function loginAsNewsEditor()
{
$newsEditorRole = Role::find(2);
$user = User::factory()->admin()->create(['name' => 'news_editor']);
$user = User::factory()->admin()->create(['name' => 'News Editor']);
$user->assignRole($newsEditorRole->name);
$this->actingAs($user);

Expand All @@ -62,7 +62,7 @@ protected function loginAsNewsEditor()
protected function loginAsEventEditor()
{
$EventEditorRole = Role::find(3);
$user = User::factory()->admin()->create(['name' => 'event_editor']);
$user = User::factory()->admin()->create(['name' => 'Event Editor']);
$user->assignRole($EventEditorRole->name);
$this->actingAs($user);

Expand Down

0 comments on commit 621c440

Please sign in to comment.