msupply-foundation / conforma-server

Conforma application manager (IRIMS) back-end
GNU Affero General Public License v3.0
4 stars 1 forks source link

Bug: User doesn't get correct permissions for old applications if added after they've expired #1119

Open CarlosNZ opened 3 months ago

CarlosNZ commented 3 months ago

When the back-end policies are doing their checks, for "review" permissions, they use review_assignments to get to reviews then applications.

The problem is, when a new user is used (or permissions added to existing user), they have no review assignments for completed applications, and they don't get re-generated as we ignore completed applications, and therefore they are unable to "extend" the applications.

Simplest fix would be to just included "expired" applications in the "refresh review assignments" process, but that's already very slow so would be reluctant to make it even slower.

Maybe we need to look at the "refresh review assignments" overall and find ways to speed it up.