Added nodeapi('access') to node.module

mikew - October 28, 2006 - 08:34
Project:Drupal
Version:6.x-dev
Component:node system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

This patch adds the operator 'access' to the hook_nodeapi hook. it is invoked after hook_access and allows a module to overwrite the hook_access result.

hook_nodeapi('access') gets invoked as node_invoke_nodeapi($node, 'access',$op,$access), where $node is the current node (if any), $op is the requested operation("view","update","delete","create") and $access is the "opinion" of hook_access (either allow(True), deny(False), NoOpinion(NULL)). Each module can either Allow the operation (return TRUE), deny (return FALSE), or don't care (return NULL). The operation is allowed if at least one module returns TRUE and none return FALSE i.e. any deny will overrule an allow. If all modules return NULL then the result of hook_access is used. The default behavior node_access will not change unless a module implements hook_nodeapi("access").

The "access" nodeapi allows the creation of custom access control modules. I have used this patch to create a module which allows more granular access control of og.

AttachmentSizeStatusTest resultOperations
node_nodeapi_access.patch1.64 KBIgnoredNoneNone

#1

Tobias Maier - October 28, 2006 - 10:04
Version:4.7.4» x.y.z
Status:needs review» needs work

no new features for drupal 4.7 and 5.0 doesn't accept new features, too

it will not apply against drupal head

#2

mikew - October 28, 2006 - 12:22

thanks tobias,

any clue what i should do with it? Can it be submitted for 5.1/6.0? Is there similar functionality planned?

and what kind work does the code need?

-Mike

#3

coreb - November 30, 2006 - 01:30
Version:x.y.z» 6.x-dev

Moving out of the "x.y.z" queue to a real queue.

#4

drewish - June 4, 2007 - 16:44
Status:needs work» duplicate

this is older but i'm going to mark it as a duplicate of http://drupal.org/node/91709 because that got a bit more traction.

AttachmentSizeStatusTest resultOperations
hook_file_142995_3.patch25.89 KBIgnoredNoneNone

#5

drewish - June 4, 2007 - 16:45

i have no idea how that patch got attached but combine that with using the wrong issue number and i'm looking like a dork. teh correct one is: http://drupal.org/node/143075

 
 

Drupal is a registered trademark of Dries Buytaert.