add is_sidetag policy test

This commit is contained in:
Tomas Kopecek 2020-03-09 16:08:40 +01:00
parent 4b5a16008d
commit 39d45e550f

View file

@ -28,7 +28,16 @@ CONFIG_FILE = "/etc/koji-hub/plugins/sidetag.conf"
CONFIG = None
class SidetagOwner(koji.policy.MatchTest):
class SidetagTest(koji.policy.MatchTest):
"""Checks, if tag is a sidetag"""
name = 'is_sidetag'
def run(self, data):
tag = get_tag(data['tag'])
return bool(tag['extra'].get('sidetag'))
class SidetagOwnerTest(koji.policy.MatchTest):
"""Checks, if user is a real owner of sidetag"""
name = 'is_sidetag_owner'