diff --git a/src/model/user/mod.rs b/src/model/user/mod.rs index ff00d28..55ba4bb 100644 --- a/src/model/user/mod.rs +++ b/src/model/user/mod.rs @@ -1172,7 +1172,6 @@ special_user!(VorstandUser, +"Vorstand"); special_user!(EventUser, +"manage_events"); special_user!(AllowedToEditPaymentStatusUser, +"kassier", +"admin"); special_user!(ManageUserUser, +"admin", +"schriftfuehrer"); -special_user!(AdminAndSchriftfuehrerUser, +"admin", +"schriftfuehrer"); special_user!(AllowedToUpdateTripToAlwaysBeShownUser, +"admin"); #[derive(FromRow, Serialize, Deserialize, Clone, Debug)] diff --git a/src/tera/admin/boat.rs b/src/tera/admin/boat.rs index 8493110..56bf5fd 100644 --- a/src/tera/admin/boat.rs +++ b/src/tera/admin/boat.rs @@ -2,7 +2,7 @@ use crate::model::{ boat::{Boat, BoatToAdd, BoatToUpdate}, location::Location, log::Log, - user::{AdminAndSchriftfuehrerUser, AdminUser, User, UserWithDetails}, + user::{User, UserWithDetails, VorstandUser}, }; use rocket::{ form::Form, @@ -17,7 +17,7 @@ use sqlx::SqlitePool; #[get("/boat")] async fn index( db: &State, - admin: AdminAndSchriftfuehrerUser, + admin: VorstandUser, flash: Option>, ) -> Template { let boats = Boat::all(db).await; @@ -40,11 +40,7 @@ async fn index( } #[get("/boat//delete")] -async fn delete( - db: &State, - admin: AdminAndSchriftfuehrerUser, - boat: i32, -) -> Flash { +async fn delete(db: &State, admin: VorstandUser, boat: i32) -> Flash { let boat = Boat::find_by_id(db, boat).await; Log::create(db, format!("{} deleted boat: {boat:?}", admin.user.name)).await; @@ -65,7 +61,7 @@ async fn update( db: &State, data: Form>, boat_id: i32, - _admin: AdminAndSchriftfuehrerUser, + _admin: VorstandUser, ) -> Flash { let boat = Boat::find_by_id(db, boat_id).await; let Some(boat) = boat else { @@ -82,7 +78,7 @@ async fn update( async fn create( db: &State, data: Form>, - _admin: AdminAndSchriftfuehrerUser, + _admin: VorstandUser, ) -> Flash { match Boat::create(db, data.into_inner()).await { Ok(_) => Flash::success(Redirect::to("/admin/boat"), "Boot hinzugefügt"), diff --git a/templates/includes/macros.html.tera b/templates/includes/macros.html.tera index 824b4c9..430cf6a 100644 --- a/templates/includes/macros.html.tera +++ b/templates/includes/macros.html.tera @@ -128,7 +128,7 @@ function setChoiceByLabel(choicesInstance, label) { Userverwaltung {% endif %} - {% if "admin" in loggedin_user.roles or "schriftfuehrer" in loggedin_user.roles %} + {% if "admin" in loggedin_user.roles or "Vorstand" in loggedin_user.roles %} Boote {% endif %} diff --git a/templates/index.html.tera b/templates/index.html.tera index 287a1aa..0edb986 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -418,14 +418,6 @@ Abzeichen - - - {% endif %} - {% if "schriftfuehrer" in loggedin_user.roles %} -