| |
@@ -63,8 +63,8 @@
|
| |
group = args[1]
|
| |
|
| |
activate_session(session, goptions)
|
| |
- if not session.hasPerm('admin'):
|
| |
- print("This action requires admin privileges")
|
| |
+ if not (session.hasPerm('admin') or session.hasPerm('tag')):
|
| |
+ print("This action requires tag or admin privileges")
|
| |
return 1
|
| |
|
| |
dsttag = session.getTag(tag)
|
| |
@@ -94,8 +94,8 @@
|
| |
group = args[1]
|
| |
|
| |
activate_session(session, goptions)
|
| |
- if not session.hasPerm('admin'):
|
| |
- print("This action requires admin privileges")
|
| |
+ if not (session.hasPerm('admin') or session.hasPerm('tag')):
|
| |
+ print("This action requires tag or admin privileges")
|
| |
return 1
|
| |
|
| |
dsttag = session.getTag(tag)
|
| |
@@ -3319,8 +3319,8 @@
|
| |
assert False # pragma: no cover
|
| |
activate_session(session, goptions)
|
| |
|
| |
- if not session.hasPerm('admin') and not options.test:
|
| |
- parser.error(_("This action requires admin privileges"))
|
| |
+ if not options.test and not (session.hasPerm('admin') or session.hasPerm('tag')):
|
| |
+ parser.error(_("This action requires tag or admin privileges"))
|
| |
|
| |
if args[0] == args[1]:
|
| |
parser.error(_('Source and destination tags must be different.'))
|
| |
@@ -3772,8 +3772,8 @@
|
| |
#most targets have the same name as their destination
|
| |
dest_tag = name
|
| |
activate_session(session, goptions)
|
| |
- if not session.hasPerm('admin'):
|
| |
- print("This action requires admin privileges")
|
| |
+ if not (session.hasPerm('admin') or session.hasPerm('target')):
|
| |
+ print("This action requires target or admin privileges")
|
| |
return 1
|
| |
|
| |
chkbuildtag = session.getTag(build_tag)
|
| |
@@ -3807,8 +3807,8 @@
|
| |
assert False # pragma: no cover
|
| |
activate_session(session, goptions)
|
| |
|
| |
- if not session.hasPerm('admin'):
|
| |
- print("This action requires admin privileges")
|
| |
+ if not (session.hasPerm('admin') or session.hasPerm('target')):
|
| |
+ print("This action requires target or admin privileges")
|
| |
return
|
| |
|
| |
targetInfo = session.getBuildTarget(args[0])
|
| |
@@ -3850,8 +3850,8 @@
|
| |
assert False # pragma: no cover
|
| |
activate_session(session, goptions)
|
| |
|
| |
- if not session.hasPerm('admin'):
|
| |
- print("This action requires admin privileges")
|
| |
+ if not (session.hasPerm('admin') or session.hasPerm('target')):
|
| |
+ print("This action requires target or admin privileges")
|
| |
return
|
| |
|
| |
target = args[0]
|
| |
@@ -3875,8 +3875,8 @@
|
| |
assert False # pragma: no cover
|
| |
activate_session(session, goptions)
|
| |
|
| |
- if not session.hasPerm('admin'):
|
| |
- print("This action requires admin privileges")
|
| |
+ if not (session.hasPerm('admin') or session.hasPerm('tag')):
|
| |
+ print("This action requires tag or admin privileges")
|
| |
return
|
| |
|
| |
tag = args[0]
|
| |
@@ -4876,8 +4876,8 @@
|
| |
parser.error(_("Please specify a name for the tag"))
|
| |
assert False # pragma: no cover
|
| |
activate_session(session, goptions)
|
| |
- if not session.hasPerm('admin'):
|
| |
- print("This action requires admin privileges")
|
| |
+ if not (session.hasPerm('admin') or session.hasPerm('tag')):
|
| |
+ print("This action requires tag or admin privileges")
|
| |
return
|
| |
opts = {}
|
| |
if options.parent:
|
| |
I went the simple route here and set the check to be either tag/target or admin and updated the error message to match.
It may be more correct to just completely remove the permission check and allow the hub to take care of failing. But since the check exists, I figured this was the minimal path.
Fixes #1729