From f6a64fbc0b568528d8a7256f2ecde15214349857 Mon Sep 17 00:00:00 2001 From: Dmitrii Kuvaiskii Date: Wed, 16 Jul 2025 08:02:13 +0000 Subject: [PATCH] docs: remove repetition in "Writing Koji plugins" There was a redundant subsection on "Ensuring the user has the required permissions". The same information is already covered in the main section. This commit removes this redundant subsection. --- docs/source/writing_a_plugin.rst | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/docs/source/writing_a_plugin.rst b/docs/source/writing_a_plugin.rst index 2702e75c..45c06228 100644 --- a/docs/source/writing_a_plugin.rst +++ b/docs/source/writing_a_plugin.rst @@ -114,27 +114,6 @@ You can try calling the new XMLRPC API with the Python client library: >>> session = koji.ClientSession("http://koji/example.org/kojihub") >>> session.mymethod(arg1, arg2, kwarg1='some value') -Ensuring the user has the required permissions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you want your new XMLRPC API to require specific permissions from the -user, all you need to do is add the following to your method: - -:: - - from koji.context import context - - def mymethod(arg1, arg2, kwarg1=None): - context.session.assertPerm("admin") - - # Here is where you actually do something - - mymethod.exported = True - -In the example above, Koji will ensure that the user is an -administrator. You could of course create your own permission, and check -for that. - Running code automatically triggered on events ----------------------------------------------