opensafely-core / airlock

Other
1 stars 0 forks source link

Filter out audit logs that a user cannot see #570

Closed bloodearnest closed 1 month ago

bloodearnest commented 1 month ago

This change ensures that users don't see audit messages that they shouldn't see.

It uses exactly same logic as previous work hiding comments/votes from users. So, this means

Fixes #534

bloodearnest commented 1 month ago

I realise that some of the questions are about previous comment-visibility functionality that isn't specific to the audit log, but given that this is refactoring the previous visibility code, I think it's probably worth fixing here.

Right, there is separate ticket for this, think https://github.com/opensafely-core/airlock/issues/512

For the first 3 screen shots, I think the actual visiblity is correct (i.e. whether its shown or not)? But the text explaining the visibility is all kinds of wrong, which the issue above is tracking.

For the 4th screenshot, that is a bug, as noted in my reply to another comment: https://github.com/opensafely-core/airlock/pull/570#discussion_r1687881914

bloodearnest commented 1 month ago

I have renamed and clarified things with comments as suggested.

I have added coverage and fixed the interaction between reject/approved/release and visible comments by taking COMPLETE status into account.

I have also fixed #512 I think by only blinding comments from the current round.