Skip to content

Commit 7b32fc4

Browse files
docs(users): add docs about listing a user's projects
Add docs about listing a user's projects. Update docs on the membership API to update the URL to the upstream docs and also add a note that it requires Administrator access to use.
1 parent 3df404c commit 7b32fc4

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 owned by the user::
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+
Administrator access is required.
249+
221250
Current User
222251
============
223252

0 commit comments

Comments
 (0)