Add error log if there is more than one project membership for a given user while checking permissions

This commit is contained in:
Nicole Tietz-Sokolskaya 2024-06-08 21:12:12 -04:00
parent 45b58ed9ab
commit adb3b3717e
2 changed files with 14 additions and 0 deletions

View File

@ -1,4 +1,10 @@
check:
cargo test
cargo fmt --check
cargo clippy
cargo build --release
run:
SECURE_SESSIONS=false RUST_LOG=debug cargo run -- --reload-templates

View File

@ -42,6 +42,14 @@ pub mod q {
};
if row_count > 0 {
if row_count > 1 {
tracing::error!(
row_count = row_count,
user_id = user_id,
project_id = project_id,
"unexpected row count: more than one project membership for this user"
)
}
Ok(Decision::Allowed)
} else {
Ok(Decision::Denied)