I have been struggling for a day with trying to get og_access and tac_lite to play nice with each other. My use case is that I was trying to limit access to most content types that were tagged with a particular vocabulary using tac_lite, to users and roles granted access. This worked well.
When I wanted to associate organic group content with this same vocabulary that is used to tie everything together, in addition to limiting access by OG members, I ran into problems. The issue was that anything that was tagged in the vocabulary used for tac_lite was entirely ignored by og_access, so any user with the vocabulary access could access private groups and posts, regardless of their membership.
After reading a bit about Drupal's ACL system, it seems that adjusting the grant priority for one module relative to the other would resolve issues where they were fighting with each other over who gets to speak first (or last?). This patch adds an additional setting on the general Organic group settings page (I wasn't sure where else to stick it, though it can be easily moved to another form) on admin/config/group/settings that allows an administrator to adjust the node grants priority of og_access. The option is only visible if og_access is turned on, and after changing the priority, it will force the permissions to be rebuilt.
The only other change was to actually store the modified grants priority in og_access_node_access_records() by reading the priority from a variable. In my very limited testing it seems to have resolved all of my woes when the priority was set to a positive number. This should address conflicts with other ACL modules as well.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | og_7.x-2.2_ACL.patch | 4.19 KB | vgalindus |
| og_access_priority.diff | 2.37 KB | hotspoons |
Comments
Comment #1
agentrickardBetter to us hook_node_access_records_alter() in D7.
See #686858: Document the correct replacement for 'priority' from hook_node_access_records()
Comment #3
vgalindus commentedI think this patch is ok. Tested and solved the problem I had with ACL. In my case I needed a negative value to make it play with flexiaccess, but solution is simple. Why it is not accepted? If tests are needed I can help writing them.
Patch for 7.x-2.2 stable release.
PS: thx for saving my time ;)
Comment #4
joelpittetDrupal 7 reached end-of-life and the D7 version of Organic Groups is no longer being developed. To keep the issue queue focused on supported versions, we’re closing older D7 issues. If you still have questions about using Organic Groups on Drupal 7, feel free to ask. While we won’t fix D7 bugs anymore, we’re happy to offer guidance to help you move forward. You can do so by opening (or reopening) a D7 issue, or by reaching out in the #og channel on Drupal Slack.
If this issue is still relevant for Drupal 10+, please open a follow-up issue or merge request with proposed changes. Contributions are always welcome! 💙