Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed permission checking bug #319

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant