From c58682e3fbcf76ffa0e99ae6ab342d8c794ce0a5 Mon Sep 17 00:00:00 2001 From: Miroslav Prasil Date: Tue, 4 Sep 2018 16:10:26 +0100 Subject: [PATCH] Fix the logic in user edditing --- src/api/core/organizations.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index 449f15f..3253eb5 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -476,8 +476,8 @@ fn edit_user(org_id: String, org_user_id: String, data: JsonUpcase }; if new_type != user_to_edit.type_ as i32 && ( - user_to_edit.type_ >= UserOrgType::Admin as i32 || - new_type >= UserOrgType::Admin as i32 + user_to_edit.type_ <= UserOrgType::Admin as i32 || + new_type <= UserOrgType::Admin as i32 ) && headers.org_user_type != UserOrgType::Owner as i32 { err!("Only Owners can grant and remove Admin or Owner privileges")