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.accessories'),
trans('general.consumables'), trans('general.consumables'),
trans('general.groups'), trans('general.groups'),
trans('general.permission_level'),
trans('general.notes'), trans('general.notes'),
trans('admin/users/table.activated'), trans('admin/users/table.activated'),
trans('general.created_at'), trans('general.created_at'),
@ -577,6 +578,18 @@ class UsersController extends Controller
$user_groups .= $user_group->name.', '; $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 // Add a new row with data
$values = [ $values = [
$user->id, $user->id,
@ -594,6 +607,7 @@ class UsersController extends Controller
$user->accessories->count(), $user->accessories->count(),
$user->consumables->count(), $user->consumables->count(),
$user_groups, $user_groups,
$permissionstring,
$user->notes, $user->notes,
($user->activated == '1') ? trans('general.yes') : trans('general.no'), ($user->activated == '1') ? trans('general.yes') : trans('general.no'),
$user->created_at, $user->created_at,

View file

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