It would be nice if the invoking module could specfiy the grant priority for each ACL.

CommentFileSizeAuthor
#2 acl_priority_1.patch2.8 KBamitaibu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

I agree. Care to write the patch?

amitaibu’s picture

Status: Active » Needs review
FileSize
2.8 KB

Patch 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... :)

salvis’s picture

Status: Needs review » Needs work

The 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?

amitaibu’s picture

It 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.

salvis’s picture

I'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()?

amitaibu’s picture

Salvis,
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.

amitaibu’s picture

Salvis,
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.

fago’s picture

It'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.

salvis’s picture

@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.

salvis’s picture

Status: Needs work » Fixed

@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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.