MyBB Community Forums

Full Version: Forum permissions no longer inherited for usergroup-limited forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As reported by kizza42 here, on upgrade to 1.8.27, subforums whose visibility is restricted to certain usergroups via "inherited" forum permissions, where there are no parent forums with "custom" forum permissions for that usergroup (i.e., all parent forums use "inherited" permissions for the usergroup), are no longer visible to those usergroups whereas they were prior to the upgrade.

My own analysis as posted in that thread in brief is that this is a regression from PR #4095: namely, the change it makes to the fetch_forum_permissions() function in the inc/functions.php file, which is to remove the initialisation $level_permissions = $fpermcache[$fid][$gid]; on what was line 1474, replacing it with a later else block in the new lines 1486-1489.
(2021-07-20, 12:15 PM)Laird Wrote: [ -> ]There seem to be two quick fixes for this issue:
  1. (Avoiding changes to the code): Customise the permissions for each relevant forum for each relevant "extra" usergroup: move, in the web UI, each of the "View", "Post Threads", "Post Replies", and "Post Polls" permissions for the relevant usergroups from the "Overview: Allowed Actions" column to the "Overview: Disallowed Actions", save them, and then move them all back to the "Overview: Allowed Actions" column and save them. This will break the inheritance, the permission indicator beside the groups' names will change from "(inherited)" to "(custom)", and the permissions should then work as expected.
  2. (Less work-intensive but requiring edits to core files): Insert at what is currently line 1697 of inc/functions.php the missing initialisation:
    			$level_permissions = $fpermcache[$fid][$gid];
    

I think #2 (or similar) should be the aim at fixing this within the code, #1 seems more like a hot fix that shouldn't be documented.
Hey Omar. Thanks very much for your feedback. I wonder though whether you've made a typo somewhere, because you seem to use #2 in two contradictory contexts. Am I right in assuming that your second #2 is a typo for #1, i.e, that #1 is the hot fix that you think shouldn't be documented?
Yeah, type. Me no English native (typo has nothing to do with it but meh Toungue)

Edit: Updated my post above.
No worries. I think I agree with your comment; my only concern is that the original reporter of the bug panicked when #1 seemed to expose forums to usergroups to which they ought not to have been exposed. Granted, we can't rule out some other cause, and I strongly suspect that there was some other cause, but it is still a concern. I'm willing though to assume that this concern is not warranted, and for us to go with #1 (or @noyle's alternative in the original thread) as the fix.
Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/4429

Thanks for contributing to MyBB!

Regards,
The MyBB Group