mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
feat(settings): provide user groups for accounts list
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
8df3310cc4
commit
8cc0c266d5
2 changed files with 15 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ use OCP\BackgroundJob\IJobList;
|
|||
use OCP\Encryption\IManager;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\IConfig;
|
||||
use OCP\IGroup;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IL10N;
|
||||
use OCP\INavigationManager;
|
||||
|
|
@ -204,6 +205,12 @@ class UsersController extends Controller {
|
|||
$serverData = [];
|
||||
// groups
|
||||
$serverData['systemGroups'] = [$adminGroupData, $recentUsersGroup, $disabledUsersGroup];
|
||||
$serverData['userGroups'] = array_values(
|
||||
array_map(
|
||||
fn (IGroup $group) => ['id' => $group->getGID(), 'name' => $group->getDisplayName()],
|
||||
$this->groupManager->getUserGroups($user),
|
||||
),
|
||||
);
|
||||
// Various data
|
||||
$serverData['isAdmin'] = $isAdmin;
|
||||
$serverData['isDelegatedAdmin'] = $isDelegatedAdmin;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,10 @@ const defaults = {
|
|||
|
||||
const state = {
|
||||
users: [],
|
||||
groups: [...(usersSettings.systemGroups ?? [])],
|
||||
groups: [
|
||||
...(usersSettings.userGroups ?? []),
|
||||
...(usersSettings.systemGroups ?? []),
|
||||
],
|
||||
orderBy: usersSettings.sortGroups ?? GroupSorting.UserCount,
|
||||
minPasswordLength: 0,
|
||||
usersOffset: 0,
|
||||
|
|
@ -264,6 +267,10 @@ const mutations = {
|
|||
}
|
||||
|
||||
const getters = {
|
||||
getUserGroups() {
|
||||
return usersSettings.userGroups ?? []
|
||||
},
|
||||
|
||||
getUsers(state) {
|
||||
return state.users
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue