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.
It would be nice if the invoking module could specfiy the grant priority for each ACL.
Comment | File | Size | Author |
---|---|---|---|
#2 | acl_priority_1.patch | 2.8 KB | amitaibu |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedI agree. Care to write the patch?
Comment #2
amitaibuPatch adds 'priority' column in {acl} module, and changes create_new_acl to:
acl_create_new_acl($module, $name, $priorty = 0)
Is this a valid solution?
p.s. First time I write an upgrade path... :)
Comment #3
salvisThe size of the column should be the same for MySQL and PostgreSQL, both smallint.
Apart from that it looks good, but what does it do?
Comment #4
amitaibuIt will not do nothing by itself, but fago asked for it. I believe CA for example will be able to implement 'weight' for the ACL.
Fixing the patch will take me few weeks as I'm traveling now.
Comment #5
salvisI'm sorry we missed your window of availability. I was a bit strained last week and couldn't react as quickly as I would have wished.
@fago: What's the point, if we don't make 'priority' available to hook_node_access_grants()?
Comment #6
amitaibuSalvis,
If there is something missing in the implementation it is because of me not fago, as i was kind trying my luck with this feature reqeust. Anyway, just wanted to thank you for your support. You and fago are becoming my unofficial mentors - I hope it is ok by you :) when i am back from my Japan travels i will dive back into it.
Comment #7
amitaibuSalvis,
If there is something missing in the implementation it is because of me not fago, as i was kind trying my luck with this feature reqeust. Anyway, just wanted to thank you for your support. You and fago are becoming my unofficial mentors - I hope it is ok by you :) when i am back from my Japan travels i will dive back into it.
Comment #8
fagoIt's great to see you working on this.
Indeed, the patch needs to be improved so that it really applies the priority when returning the grants. When this patch is done, I can make CA make use of the priority, so that the configured CA priority can be applied to the CA-ACLs too.
Comment #9
salvis@Amitaibu: sure, my pleasure. :)
Regarding your patch: db_add_column() only works with pgsql and 'not null' is missing. Whenever you do something in .install, look at core for precedents.
Comment #10
salvis@Amitaibu: You've tried adding the 'priority' to {acl}, but ACL manages grants by nid, not by acl_id. CA uses one acl_id per nid, so they're pretty synonymous for CA, but other modules may do it differently.
'priority' needs to go into {acl_node}, and the additional $priority parameter to acl_node_add_acl().
I can't wait for you to get back, because I need this in order to complete the D6 port of Forum Access, so I committed the update to the 5.x branch (for 5.x-1.7) and to MAIN.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.