Skip to content

Commit

Permalink
ext/admin: add explanation to PermissionDenied
Browse files Browse the repository at this point in the history
  • Loading branch information
woju committed Jun 22, 2017
1 parent 2942f8b commit 8c9ce05
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qubes/ext/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def on_tag_set_or_remove(self, vm, event, arg, **kwargs):
'''Forbid changing specific tags'''
# pylint: disable=no-self-use,unused-argument
if arg.startswith('created-by-'):
raise qubes.api.PermissionDenied()
raise qubes.api.PermissionDenied(
'changing this tag is prohibited by {}.{}'.format(
__name__, type(self).__name__))

# TODO create that extension in the first place
# TODO create that tag here (need to figure out how to pass mgmtvm name)

0 comments on commit 8c9ce05

Please sign in to comment.