modify_user CLI
@@ -98,14 +98,26 @@ def parse_args():
user_add = user_subparsers.add_parser("add", help="Add a user to the QCFractal server.")
user_add.add_argument("username", default=None, type=str, help="The username to add.")
- user_add.add_argument("--password", default=None, type=str, required=False, help="The password for the user. If None, a default one will be created and printed.")
- user_add.add_argument("--permissions", nargs='+', default=None, type=str, required=True, help="Permissions for the user. Allowed values: read, write, compute, admin.")
+ user_add.add_argument("--password", default=None, type=str, required=False,
+ help="The password for the user. If None, a default one will be created and printed.")
+ user_add.add_argument("--permissions", nargs='+', default=None, type=str, required=True,
+ help="Permissions for the user. Allowed values: read, write, compute, admin.")
user_show = user_subparsers.add_parser("show", help="Show the user's current permissions.")
user_show.add_argument("username", default=None, type=str, help="The username to show.")
- user_show = user_subparsers.add_parser("remove", help="Remove a user.")
- user_show.add_argument("username", default=None, type=str, help="The username to remove.")
+ user_modify = user_subparsers.add_parser("modify", help="Change a user's password or permissions.")
+ user_modify.add_argument("username", default=None, type=str, help="The username to modify.")
+ user_modify_password = user_modify.add_mutually_exclusive_group()
+ user_modify_password.add_argument("--password", type=str, default=None, required=False,
+ help="Change the user's password to the specified value.")
+ user_modify_password.add_argument("--reset-password", action='store_true',
+ help="Reset the user's password. A new password will be generated and printed.")
+ user_modify.add_argument("--permissions", nargs='+', default=None, type=str, required=False,
+ help="Change the users's permissions. Allowed values: read, write, compute, queue, admin.")
+
+ user_remove = user_subparsers.add_parser("remove", help="Remove a user.")
+ user_remove.add_argument("username", default=None, type=str, help="The username to remove.")
### Move args around
