Skip to content

docs(users): add docs about listing a user's projects #2125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion docs/gl_objects/users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=========================

Expand All @@ -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::

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

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

.. note::

This endpoint requires admin access.

Current User
============

Expand Down