mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
knight should dry-run unless you specify -f
(imported from commit fd0e5af1d941c6fadcbc14ff7f86f71a170a503e)
This commit is contained in:
@@ -19,6 +19,11 @@ ONLY perform this on customer request from an authorized person.
|
||||
"""
|
||||
|
||||
option_list = BaseCommand.option_list + (
|
||||
make_option('-f', '--for-real',
|
||||
dest='ack',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help='Acknowledgement that this is done according to policy.'),
|
||||
make_option('--revoke',
|
||||
dest='grant',
|
||||
action="store_false",
|
||||
@@ -40,11 +45,18 @@ ONLY perform this on customer request from an authorized person.
|
||||
if profile.has_perm('administer', profile.realm):
|
||||
raise CommandError("User already has permission for this realm.")
|
||||
else:
|
||||
assign_perm('administer', profile, profile.realm)
|
||||
print "Done!"
|
||||
if options['ack']:
|
||||
assign_perm('administer', profile, profile.realm)
|
||||
print "Done!"
|
||||
else:
|
||||
print "Would have made %s an administrator for %s" % (email, profile.realm.domain)
|
||||
else:
|
||||
if profile.has_perm('administer', profile.realm):
|
||||
remove_perm('administer', profile, profile.realm)
|
||||
print "Done!"
|
||||
if options['ack']:
|
||||
remove_perm('administer', profile, profile.realm)
|
||||
print "Done!"
|
||||
else:
|
||||
print "Would have removed %s's administrator rights on %s" % (email,
|
||||
profile.realm.domain)
|
||||
else:
|
||||
raise CommandError("User did not have permission for this realm!")
|
||||
|
||||
Reference in New Issue
Block a user