Skip to content

Commit 1fbfb22

Browse files
authored
Merge pull request #2125 from python-gitlab/jlvillal/user_docs
docs(users): add docs about listing a user's projects
2 parents d15fea0 + 065a1a5 commit 1fbfb22

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

docs/gl_objects/users.rst

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,31 @@ Revoke (delete) an impersonation token for a user::
192192
i_t.delete()
193193

194194

195+
User projects
196+
=========================
197+
198+
References
199+
----------
200+
201+
* v4 API:
202+
203+
+ :class:`gitlab.v4.objects.UserProject`
204+
+ :class:`gitlab.v4.objects.UserProjectManager`
205+
+ :attr:`gitlab.v4.objects.User.projects`
206+
207+
* GitLab API: https://docs.gitlab.com/ee/api/projects.html#list-user-projects
208+
209+
List visible projects in the user's namespace::
210+
211+
projects = user.projects.list()
212+
213+
.. note::
214+
215+
Only the projects in the user’s namespace are returned. Projects owned by
216+
the user in any group or subgroups are not returned. An empty list is
217+
returned if a profile is set to private.
218+
219+
195220
User memberships
196221
=========================
197222

@@ -204,7 +229,7 @@ References
204229
+ :class:`gitlab.v4.objects.UserMembershipManager`
205230
+ :attr:`gitlab.v4.objects.User.memberships`
206231

207-
* GitLab API: https://docs.gitlab.com/ee/api/users.html#user-memberships-admin-only
232+
* GitLab API: https://docs.gitlab.com/ee/api/users.html#user-memberships
208233

209234
List direct memberships for a user::
210235

@@ -218,6 +243,10 @@ List only direct group memberships::
218243

219244
memberships = user.memberships.list(type='Namespace')
220245

246+
.. note::
247+
248+
This endpoint requires admin access.
249+
221250
Current User
222251
============
223252

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy