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.
This commit is contained in:
parent
adbe584a4c
commit
f6a64fbc0b
1 changed files with 0 additions and 21 deletions
|
|
@ -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
|
||||
----------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue