| |
@@ -34,14 +34,19 @@
|
| |
if not result and raise_error:
|
| |
raise koji.GenericError("Not a sidetag: %(name)s" % taginfo)
|
| |
|
| |
+ return result
|
| |
+
|
| |
|
| |
def is_sidetag_owner(taginfo, user, raise_error=False):
|
| |
"""Check, that given user is owner of the sidetag"""
|
| |
result = (taginfo['extra'].get('sidetag') and
|
| |
- taginfo['extra'].get('sidetag_user_id') == user['id'])
|
| |
+ (taginfo['extra'].get('sidetag_user_id') == user['id'] or
|
| |
+ context.session.hasPerm('admin'))))
|
| |
if not result and raise_error:
|
| |
raise koji.ActionNotAllowed("This is not your sidetag")
|
| |
|
| |
+ return result
|
| |
+
|
| |
|
| |
# Policy tests
|
| |
class SidetagTest(koji.policy.MatchTest):
|
| |
is_sidetag()
,is_sidetag_owner()
functionsFixes #2321