Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: document how to usesudo if modifying an object#2928

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intomainfromjlvillal/issue_532_sudo
Jul 15, 2024
Merged
Changes fromall 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
21 changes: 21 additions & 0 deletionsdocs/api-usage.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -411,6 +411,27 @@ user. For example:

p = gl.projects.create({'name': 'awesome_project'}, sudo='user1')

.. warning::
When using ``sudo``, its usage is not remembered. If you use ``sudo`` to
retrieve an object and then later use ``save()`` to modify the object, it
will not use ``sudo``. You should use ``save(sudo='user1')`` if you want to
perform subsequent actions as the user.

Updating with ``sudo``
----------------------

An example of how to ``get`` an object (using ``sudo``), modify the object, and
then ``save`` the object (using ``sudo``):

.. code-block:: python

group = gl.groups.get('example-group')
notification_setting = group.notificationsettings.get(sudo='user1')
notification_setting.level = gitlab.const.NOTIFICATION_LEVEL_GLOBAL
# Must use `sudo` again when doing the save.
notification_setting.save(sudo='user1')


Logging
=======

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp