in preparation to moving userdata into app, we switched to arbitrary groups
All checks were successful
CI/CD Pipeline / test (push) Successful in 11m4s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2023-12-23 21:27:52 +01:00
parent e4da952a62
commit c7d7d0ca83
29 changed files with 396 additions and 256 deletions

View File

@ -20,7 +20,7 @@ impl UserTrip {
return Err(UserTripError::DetailsLocked);
}
if user.is_guest && !trip_details.allow_guests {
if user.has_role(db, "scheckbuch").await && !trip_details.allow_guests {
return Err(UserTripError::GuestNotAllowedForThisEvent);
}
@ -211,11 +211,12 @@ mod test {
fn test_fail_create_is_cox_planned_event() {
let pool = testdb!();
let cox: CoxUser = User::find_by_name(&pool, "cox".into())
.await
.unwrap()
.try_into()
.unwrap();
let cox = CoxUser::new(
&pool,
User::find_by_name(&pool, "cox".into()).await.unwrap(),
)
.await
.unwrap();
let planned_event = PlannedEvent::find_by_id(&pool, 1).await.unwrap();
Trip::new_join(&pool, &cox, &planned_event).await.unwrap();