in preparation to moving userdata into app, we switched to arbitrary groups
This commit is contained in:
@@ -141,7 +141,7 @@ ORDER BY created_at DESC
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
let user = User::find_by_id(db, boat.user_id_fixed).await.unwrap();
|
||||
if user.is_tech {
|
||||
if user.has_role(db, "tech").await {
|
||||
return self
|
||||
.verified(
|
||||
db,
|
||||
@@ -162,7 +162,7 @@ ORDER BY created_at DESC
|
||||
boat: BoatDamageVerified<'_>,
|
||||
) -> Result<(), String> {
|
||||
if let Some(verifier) = User::find_by_id(db, boat.user_id_verified).await {
|
||||
if !verifier.is_tech {
|
||||
if !verifier.has_role(db, "tech").await {
|
||||
Log::create(db, format!("User {verifier:?} tried to verify boat {boat:?}. The user is no tech. Manually craftted request?")).await;
|
||||
return Err("You are not allowed to verify the boat!".into());
|
||||
}
|
||||
|
Reference in New Issue
Block a user