Merge pull request #14614 from akemidx/feature/sc-19796

ADDED: Export User Permissions (Superuser & Admin)
This commit is contained in:
snipe 2024-05-30 13:41:26 +01:00 committed by GitHub
commit f710b1aac3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View file

@ -563,6 +563,7 @@ class UsersController extends Controller
trans('general.accessories'),
trans('general.consumables'),
trans('general.groups'),
trans('general.permission_level'),
trans('general.notes'),
trans('admin/users/table.activated'),
trans('general.created_at'),
@ -577,6 +578,18 @@ class UsersController extends Controller
$user_groups .= $user_group->name.', ';
}
$permissionstring = "";
if(array_key_exists("superuser", json_decode($user->permissions, true))) {
$permissionstring = trans('general.superuser');
}
elseif(array_key_exists("admin", json_decode($user->permissions, true))) {
$permissionstring = trans('general.admin');
}
else {
$permissionstring = trans('general.user');
}
// Add a new row with data
$values = [
$user->id,
@ -594,6 +607,7 @@ class UsersController extends Controller
$user->accessories->count(),
$user->consumables->count(),
$user_groups,
$permissionstring,
$user->notes,
($user->activated == '1') ? trans('general.yes') : trans('general.no'),
$user->created_at,

View file

@ -143,6 +143,7 @@ return [
'generate_labels' => 'Generate Labels',
'github_markdown' => 'This field accepts <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
'groups' => 'Groups',
'permission_level' => 'Permission Level',
'gravatar_email' => 'Gravatar Email Address',
'gravatar_url' => '<a href="http://gravatar.com"><small>Change your avatar at Gravatar.com</small></a>.',
'history' => 'History',
@ -274,6 +275,7 @@ return [
'status_labels' => 'Status Labels',
'status' => 'Status',
'accept_eula' => 'Acceptance Agreement',
'superuser' => 'Superuser',
'supplier' => 'Supplier',
'suppliers' => 'Suppliers',
'sure_to_delete' => 'Are you sure you wish to delete',