Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When defining a form, you can define custom report access callbacks instead of just using a global user permission. It would be nice if you could do something similar for the bypass access. An example use-case is that I would like to allow OG administrators to bypass mollom access when editing their group content.
Comment | File | Size | Author |
---|---|---|---|
#1 | mollom-support-bypass-access-callbacks-2284511-1.patch | 1.59 KB | jojonaloha |
Comments
Comment #1
jojonaloha CreditAttribution: jojonaloha commentedAttached patch adds a check for a 'bypass access callbacks' key in the form info. You can see an example of how I would use this in a sandbox module I'm made to add OG integration: https://drupal.org/node/2283955
Here is the array structure:
The callback function would look like this:
Comment #2
eshta CreditAttribution: eshta commentedBy returning here the users who would bypass mollom form protection are also missing on the delete/feedback integration that follows after the user_access if block. I don't believe you can equate those two. Looks like Mollom currently does this right below there in the bypass_access permission check and this also seems wrong. Maybe we can fix both at the same time?
I do wonder, however, if the scenario you describe can't be handled with the existing bypass_access permissions array. The idea is interesting though and I can see how it would make things more flexible. We'd need to add documentation to the mollom.api.php file as well a tests to ensure that callbacks are called.