We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
sudo
1 parent44f62c4 commitb5fb1b8Copy full SHA for b5fb1b8
docs/api-usage.rst
@@ -411,6 +411,27 @@ user. For example:
411
412
p= gl.projects.create({'name':'awesome_project'},sudo='user1')
413
414
+..warning::
415
+ When using ``sudo``, its usage is not remembered. What this means is that if
416
+ you use ``sudo`` to retrieve an object and then later use ``save()`` to
417
+ modify the object it will not use ``sudo``. In that case you should do
418
+ ``save(sudo='user1')``
419
+
420
+Updating with ``sudo``
421
+----------------------
422
423
+An example of how to ``get`` an object (using ``sudo``), modify the object, and
424
+then ``save`` the object (using ``sudo``)
425
426
+..code-block::python
427
428
+ group= gl.groups.get('example-group')
429
+ notification_setting= group.notificationsettings.get(sudo='user1')
430
+ notification_setting.level= gitlab.const.NOTIFICATION_LEVEL_GLOBAL
431
+# Must use `sudo` again when doing the save.
432
+ notifcation_setting.save(sudo='user1')
433
434
435
Logging
436
=======
437