Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
c821aa89
Commit
c821aa89
authored
3 years ago
by
Quentin Ribac
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #17436 TIME 0:20 extended GET/manageablegroups
parent
afbb7680
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/group/controllers/PrivilegeController.php
+0
-1
0 additions, 1 deletion
src/app/group/controllers/PrivilegeController.php
src/app/user/controllers/UserController.php
+8
-2
8 additions, 2 deletions
src/app/user/controllers/UserController.php
with
8 additions
and
3 deletions
src/app/group/controllers/PrivilegeController.php
+
0
−
1
View file @
c821aa89
...
@@ -17,7 +17,6 @@ namespace Group\controllers;
...
@@ -17,7 +17,6 @@ namespace Group\controllers;
use
SrcCore\models\ValidatorModel
;
use
SrcCore\models\ValidatorModel
;
use
User\models\UserGroupModel
;
use
User\models\UserGroupModel
;
use
Group\models\GroupPrivilegeModel
;
use
Group\models\GroupPrivilegeModel
;
use
PHPUnit\Util\Xml\Validator
;
use
User\controllers\UserController
;
use
User\controllers\UserController
;
class
PrivilegeController
class
PrivilegeController
...
...
This diff is collapsed.
Click to expand it.
src/app/user/controllers/UserController.php
+
8
−
2
View file @
c821aa89
...
@@ -826,7 +826,7 @@ class UserController
...
@@ -826,7 +826,7 @@ class UserController
if
(
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$args
[
'userId'
],
'privilege'
=>
'manage_groups'
]))
{
if
(
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$args
[
'userId'
],
'privilege'
=>
'manage_groups'
]))
{
$groups
=
GroupModel
::
get
([
'select'
=>
[
'id'
]]);
$groups
=
GroupModel
::
get
([
'select'
=>
[
'id'
]]);
$groups
=
array_column
(
$groups
,
'id'
);
$groups
=
array_column
(
$groups
,
'id'
);
return
$g
roup
s
;
return
G
roup
Model
::
get
()
;
}
}
$groups
=
UserGroupModel
::
get
([
'select'
=>
[
'group_id'
],
'where'
=>
[
'user_id = ?'
],
'data'
=>
[
$args
[
'userId'
]]]);
$groups
=
UserGroupModel
::
get
([
'select'
=>
[
'group_id'
],
'where'
=>
[
'user_id = ?'
],
'data'
=>
[
$args
[
'userId'
]]]);
...
@@ -838,7 +838,13 @@ class UserController
...
@@ -838,7 +838,13 @@ class UserController
$currentGroups
=
$parameters
[
'authorized'
]
??
[];
$currentGroups
=
$parameters
[
'authorized'
]
??
[];
$manageableGroups
=
array_merge
(
$manageableGroups
,
$currentGroups
);
$manageableGroups
=
array_merge
(
$manageableGroups
,
$currentGroups
);
}
}
$manageableGroups
=
array_unique
(
$manageableGroups
);
return
array_unique
(
$manageableGroups
);
$manageableGroups
=
GroupModel
::
get
([
'where'
=>
[
'id in (?)'
],
'data'
=>
[
$manageableGroups
]
]);
return
$manageableGroups
;
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment