-
Notifications
You must be signed in to change notification settings - Fork 673
Description
Description of the problem, including code/CLI snippet
Current implementation to remove members from GitLab group is:
group.members.delete(member_id)
Additionally to the member_id
parameter, the rest API endpoint provides two options which are currently not available in the python-gitlab group members delete method (Reference):
skip_subresources
unassign_issuables
This is especially relevant, as skip_subresources
has the default value false
. The pendant in the Web UI is the Also remove direct user membership from subgroups and projects
option which needs to be ticked actively, suggerating a default value skip_subresources = true
:

As the option for skip_subresources
is not available in the python-gitlab library, the default value of false
is enforced. This may lead to unexpected behavior, when only the group level access right should be removed without removing access rights to subresources.
Example
- Create group
foo
- Create project
foo/bar
- Grant user
xyz
Maintainer access to projectfoo/bar
- Grant user
xyz
Developer access to groupfoo
- Delete
xyz
as member from groupfoo
using default behavior:
A) WebUI: userxyz
stays Maintainer member in projectfoo/bar
B) python-gitlab: userxyz
looses also Maintainer access in projectfoo/bar
Expected Behavior
There should be the same parameters available in group.members.delete(member_id)
as in the Rest API:
group.members.delete(
member_id=membe_id,
skip_subresources=False,
unassign_issuables=False
)
Actual Behavior
Currently those flags can not be specified, enforcing the default behavior defined in the Rest API.
Specifications
- python-gitlab version: 6.1.0
- Gitlab server version (or gitlab.com): v17.11.6-ee