Closed (won't fix)
Project:
ACL
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2011 at 03:32 UTC
Updated:
11 Oct 2011 at 19:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
iva2k commentedAttached is a patch that provides generic data field in acl_node table. All changes are transparent to all existing modules.
Comment #2
iva2k commentedComment #3
salvisThere's a core mechanism to do that: hook_schema_alter(). It lets you change the schema of every table in your database. Serialized varchar may work for your requirements, but others might need two ints or unserialized varchar (so that they can index and search on that column, too).
I think implementing hook_schema_alter() in your module is the better approach, rather than adding something "generic" to ACL that caters only to a small percentage of users.
Hint: Be sure to make the additional column optional!
Comment #4
iva2k commentedThanks for quick response. I will ponder on hook_schema_alter(), though data column seems more natural to me.
What if I remove serialize/unserialize but keep the varchar, will you commit the feature? That will allow other modules to have more flexibility. For cases like two ints they can store as a formatted string and still perform search if needed (can use > or < on strings too). This column's purpose is not to provide searches, so it is not indexed anyway, it is just to provide ways for storing arbitrary details. For instance, there are no calls in current API to search ACLs on grant_view/delete/update columns.
Comment #5
salvishook_schema_alter() is data column, customized to your exact needs, without bothering anyone else who may have different needs, or, more likely, no use for an additional column at all. Your only inconvenience is having to write your own version of acl_node_add_acl().
This is not a generally useful feature but a specific customization for your site. Enabling such customizations is the reason for having hooks like hook_schema_alter().
So, no, I won't commit this, sorry.
Comment #5.0
salvisminor edit