From e7111664ea41d03ddd80da6428fc14b402d9924a Mon Sep 17 00:00:00 2001 From: Dmitrii Kuvaiskii Date: Jul 16 2025 13:32:38 +0000 Subject: 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. --- diff --git a/docs/source/writing_a_plugin.rst b/docs/source/writing_a_plugin.rst index 2702e75..45c0622 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 ----------------------------------------------