switch from cox to steeringuser, which contains both cox + bootsfuehrer
This commit is contained in:
@@ -50,16 +50,20 @@ pub struct UserWithDetails {
|
||||
#[serde(flatten)]
|
||||
pub user: User,
|
||||
pub amount_unread_notifications: i32,
|
||||
pub allowed_to_steer: bool,
|
||||
pub on_water: bool,
|
||||
pub roles: Vec<String>,
|
||||
}
|
||||
|
||||
impl UserWithDetails {
|
||||
pub async fn from_user(user: User, db: &SqlitePool) -> Self {
|
||||
let allowed_to_steer =
|
||||
user.has_role(db, "cox").await || user.has_role(db, "Bootsführer").await;
|
||||
Self {
|
||||
on_water: user.on_water(db).await,
|
||||
roles: user.roles(db).await,
|
||||
amount_unread_notifications: user.amount_unread_notifications(db).await,
|
||||
allowed_to_steer,
|
||||
user,
|
||||
}
|
||||
}
|
||||
@@ -1153,7 +1157,7 @@ macro_rules! special_user {
|
||||
}
|
||||
|
||||
special_user!(TechUser, +"tech");
|
||||
special_user!(CoxUser, +"cox");
|
||||
special_user!(SteeringUser, +"cox", +"Bootsführer");
|
||||
special_user!(AdminUser, +"admin");
|
||||
special_user!(AllowedForPlannedTripsUser, +"Donau Linz", +"scheckbuch");
|
||||
special_user!(DonauLinzUser, +"Donau Linz", -"Unterstützend", -"Förderndes Mitglied");
|
||||
|
Reference in New Issue
Block a user