Add error log if there is more than one project membership for a given user while checking permissions
This commit is contained in:
parent
45b58ed9ab
commit
adb3b3717e
2 changed files with 14 additions and 0 deletions
6
Makefile
6
Makefile
|
@ -1,4 +1,10 @@
|
||||||
|
|
||||||
|
check:
|
||||||
|
cargo test
|
||||||
|
cargo fmt --check
|
||||||
|
cargo clippy
|
||||||
|
cargo build --release
|
||||||
|
|
||||||
run:
|
run:
|
||||||
SECURE_SESSIONS=false RUST_LOG=debug cargo run -- --reload-templates
|
SECURE_SESSIONS=false RUST_LOG=debug cargo run -- --reload-templates
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,14 @@ pub mod q {
|
||||||
};
|
};
|
||||||
|
|
||||||
if row_count > 0 {
|
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)
|
Ok(Decision::Allowed)
|
||||||
} else {
|
} else {
|
||||||
Ok(Decision::Denied)
|
Ok(Decision::Denied)
|
||||||
|
|
Loading…
Reference in a new issue