summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2022-07-04 23:42:51 -0700
committerJohn L. Villalovos <john@sodarock.com>2022-07-04 23:42:51 -0700
commit065a1a5a32d34286df44800084285b30b934f911 (patch)
treeafa4e3ee6afd5409d12d34edc7bdf56eb0787486 /docs
parentd15fea0ccf44732a2462fc7c63a97495efeb9f99 (diff)
downloadgitlab-065a1a5a32d34286df44800084285b30b934f911.tar.gz
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.
Diffstat (limited to 'docs')
-rw-r--r--docs/gl_objects/users.rst31
1 files changed, 30 insertions, 1 deletions
diff --git a/docs/gl_objects/users.rst b/docs/gl_objects/users.rst
index 996459d..80eea1c 100644
--- a/docs/gl_objects/users.rst
+++ b/docs/gl_objects/users.rst
@@ -192,6 +192,31 @@ Revoke (delete) an impersonation token for a user::
i_t.delete()
+User projects
+=========================
+
+References
+----------
+
+* v4 API:
+
+ + :class:`gitlab.v4.objects.UserProject`
+ + :class:`gitlab.v4.objects.UserProjectManager`
+ + :attr:`gitlab.v4.objects.User.projects`
+
+* GitLab API: https://docs.gitlab.com/ee/api/projects.html#list-user-projects
+
+List visible projects in the user's namespace::
+
+ projects = user.projects.list()
+
+.. note::
+
+ Only the projects in the user’s namespace are returned. Projects owned by
+ the user in any group or subgroups are not returned. An empty list is
+ returned if a profile is set to private.
+
+
User memberships
=========================
@@ -204,7 +229,7 @@ References
+ :class:`gitlab.v4.objects.UserMembershipManager`
+ :attr:`gitlab.v4.objects.User.memberships`
-* GitLab API: https://docs.gitlab.com/ee/api/users.html#user-memberships-admin-only
+* GitLab API: https://docs.gitlab.com/ee/api/users.html#user-memberships
List direct memberships for a user::
@@ -218,6 +243,10 @@ List only direct group memberships::
memberships = user.memberships.list(type='Namespace')
+.. note::
+
+ This endpoint requires admin access.
+
Current User
============