Update route function to revoke CCPO superuser status

This commit is contained in:
leigh-mil
2019-08-08 14:09:10 -04:00
parent 54239a520e
commit e35399d8f5
4 changed files with 29 additions and 3 deletions

View File

@@ -62,6 +62,6 @@ def confirm_new_user():
@user_can(Permissions.DELETE_CCPO_USER, message="remove ccpo user")
def remove_access(user_id):
user = Users.get(user_id)
# update user to remove perms
# flash alert to confirm removing ccpo perms
Users.revoke_ccpo_perms(user)
flash("ccpo_user_removed", user_name=user.full_name)
return redirect(url_for("ccpo.users"))

View File

@@ -40,6 +40,11 @@ MESSAGES = {
"message_template": translate("ccpo.form.user_not_found_text"),
"category": "info",
},
"ccpo_user_removed": {
"title_template": translate("flash.success"),
"message_template": "You have successfully removed {{ user_name }}'s CCPO permissions.",
"category": "success",
},
"environment_added": {
"title_template": translate("flash.success"),
"message_template": """