[development] access control for periodicals - does my plan makesense?

Dave Cohen drupal at dave-cohen.com
Sun Sep 24 00:27:02 UTC 2006


On Saturday 23 September 2006 16:42, Nedjo Rogers wrote:
> > So my plan is to put some logic in hook_nodeapi.  If $op == 'view', and
> > the
> > user has not subscribed to the node in question, I can do something like:
> >
> >    $node->body = t('Sorry, you have to subscribe to view this.');
>
> You could instead use the 'view' op in hook_access of the node type. As
> with all ops of hook_access, it overrides what's in the node_access table.

Yes, but only if I define the node type, which I prefer not to do.  
hook_access is only called for the module that defines the node.


More information about the development mailing list