Skip to content

Conversation

franga2000
Copy link
Contributor

@franga2000 franga2000 commented Mar 10, 2025

The globally_* variables were being overridden in the for f in forum loop, which screwed them up for the next iteration.

TL;DR: If your forums were ordered [public1, private, public2] it worked, public2 wasn't visible, because its permission check ran after the check for private. This fix simply renames the variables so nothing inside one loop iteration influences the next iteration.

For example:

  • every user in a "members" group has global read permissions (globally_granted_group_perms = ["can_see_forum", "can_read_forum"])
  • that group also has nongranted permissions for a specific forum, line an "admins only" forum (globally_nongranted_group_perms = ["can_see_forum", "can_read_forum"])
  • on the "normal" forums, nothing is changed
  • on the "admins only" forum, globally_granted_group_perms gets filtered to = []
  • on the remaining "normal" forums, globally_granted_group_perms = [] is the starting point, so no permissions are returned

The test I added failed before the fix, now it passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant