Skip to content

Commit bb00c33

Browse files
committed
Ordered entity permission roles by display name
Closes #2782
1 parent 807f92b commit bb00c33

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/Auth/Role.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static function getSystemRole(string $systemName): ?Role
9292
}
9393

9494
/**
95-
* Get all visible roles
95+
* Get all visible roles.
9696
*/
9797
public static function visible(): Collection
9898
{
@@ -104,7 +104,10 @@ public static function visible(): Collection
104104
*/
105105
public static function restrictable(): Collection
106106
{
107-
return static::query()->where('system_name', '!=', 'admin')->get();
107+
return static::query()
108+
->where('system_name', '!=', 'admin')
109+
->orderBy('display_name', 'asc')
110+
->get();
108111
}
109112

110113
/**

resources/views/form/entity-permissions.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<table permissions-table class="table permissions-table toggle-switch-list" style="{{ !$model->restricted ? 'display: none' : '' }}">
2626
<tr>
2727
<th>{{ trans('common.role') }}</th>
28-
<th @if($model->isA('page')) colspan="3" @else colspan="4" @endif>
28+
<th colspan="{{ $model->isA('page') ? '3' : '4' }}">
2929
{{ trans('common.actions') }}
3030
<a href="#" permissions-table-toggle-all class="text-small ml-m text-primary">{{ trans('common.toggle_all') }}</a>
3131
</th>

0 commit comments

Comments
 (0)