It is useful for modules to store more information in the grant_view, grant_update, Grant_delete columns than just 1 or 0. This patch treats 0 and 1 just as before, and any value greater than 1 is assumed TRUE (just like PHP).

Organic groups already has 2 needs for this. One would be to store the 'group role' of a member in this table.

Total characters changed: 1

CommentFileSizeAuthor
node_access_0.patch620 bytesmoshe weitzman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

I like this patch and as far as I can tell, it won't break anything.

moshe weitzman’s picture

JonBob confirmed to me that he knows of nothing that breaks with this patch and supports the new functionality.

Steven’s picture

Status: Needs review » Fixed

Committed to HEAD.

Steven’s picture

Status: Fixed » Active

Note: I committed the patch, but the database columns are tinyint(1) in mysql. Shouldn't those be changed too then? Otherwise it's a bit useless.

Killes also raised some performance concerns, but as far as I can see this patch makes no difference as grants are only keyed on (nid,gid,realm), not on any of the grant columns (and even if it were keyed, I don't think a simple greater-than comparison is noticably slower than an is-equal check as keys are typically ordered).

moshe weitzman’s picture

Title: Allow for more integers in node_access grant_x columns » Change node_access DB schema to allow for more integers in grant columns
chx’s picture

Version: x.y.z » 6.x-dev
Status: Active » Closed (won't fix)

there is no big need for this apparently...