in preparation to moving userdata into app, we switched to arbitrary groups
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user