Commit 117bd957 authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Change user id of admin in admin pages

parent 55df49ee
Pipeline #612 passed with stage
in 15 minutes and 4 seconds
...@@ -1040,7 +1040,7 @@ pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str, ...@@ -1040,7 +1040,7 @@ pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str,
-> MedalValueResult -> MedalValueResult
{ {
let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?; let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?;
if session.id != 35 { if session.id != 1 {
return Err(MedalError::AccessDenied); return Err(MedalError::AccessDenied);
} }
...@@ -1053,7 +1053,7 @@ pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str, ...@@ -1053,7 +1053,7 @@ pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str,
pub fn admin_show_user<T: MedalConnection>(conn: &T, user_id: i32, session_token: &str) -> MedalValueResult { pub fn admin_show_user<T: MedalConnection>(conn: &T, user_id: i32, session_token: &str) -> MedalValueResult {
let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?; let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?;
if session.id != 35 { if session.id != 1 {
return Err(MedalError::AccessDenied); return Err(MedalError::AccessDenied);
} }
...@@ -1090,7 +1090,7 @@ pub fn admin_delete_user<T: MedalConnection>(conn: &T, user_id: i32, session_tok ...@@ -1090,7 +1090,7 @@ pub fn admin_delete_user<T: MedalConnection>(conn: &T, user_id: i32, session_tok
pub fn admin_show_group<T: MedalConnection>(conn: &T, group_id: i32, session_token: &str) -> MedalValueResult { pub fn admin_show_group<T: MedalConnection>(conn: &T, group_id: i32, session_token: &str) -> MedalValueResult {
let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?; let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?;
if session.id != 35 { if session.id != 1 {
return Err(MedalError::AccessDenied); return Err(MedalError::AccessDenied);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment