[development] node_access for not the global user?

Robert Douglass rob at robshouse.net
Mon Mar 5 18:40:01 UTC 2007


Hi. This is Moshe. I'd like to see an impersonation API as well.

;-)

Moshe Weitzman wrote:
> Alan Dixon wrote:
>> I'm looking for a way to determine if an arbitrary user (i.e, not the
>> global or current user) has access to a node. The node_access()
>> function in the node.module looks like what I want, except that it
>> only applies to the current user. I only actually care if the user can
>> view the node.
>>
>> Any ideas?
>>
>> I'd thought of redefining the $_GLOBAL['user'] temporarily and then
>> running node_access, but I think that might be dangerous (side
>> effects?). I could also just copy that node_access function and change
>> the references to the global user, but I'm hoping someone's already
>> thought through a more elegant solution.
>>
>
> this was a feature of node_access() but it never worked right so it 
> was removed in 5. there is an issue on it somewhere.
>
> i would love to see an impersonation API becase we need it for 
> programmatically submitting forms, nodes, etc
>


-- 
* * * * *
Lullabot's First Ever Advanced Workshops Are Here!
Drupal API & Module Building - Advanced Drupal Themeing
April 9th-13th - Providence, RI
Early Bird Discounts Available Now
http://www.lullabot.com/training
* * * * *



More information about the development mailing list