mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-23 04:10:22 +00:00
Set order to role permissions API response
This commit is contained in:
parent
723f108bd9
commit
3c3c2ae9b5
1 changed files with 1 additions and 2 deletions
|
@ -4,7 +4,6 @@ namespace BookStack\Http\Controllers\Api;
|
|||
|
||||
use BookStack\Auth\Permissions\PermissionsRepo;
|
||||
use BookStack\Auth\Role;
|
||||
use BookStack\Exceptions\UserUpdateException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
@ -127,7 +126,7 @@ class RoleApiController extends ApiController
|
|||
{
|
||||
$role->load('users:id,name,slug');
|
||||
$role->unsetRelation('permissions');
|
||||
$role->setAttribute('permissions', $role->permissions()->pluck('name'));
|
||||
$role->setAttribute('permissions', $role->permissions()->orderBy('name', 'asc')->pluck('name'));
|
||||
$role->makeVisible(['users', 'permissions']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue