<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Good afternoon,<div><br></div><div>Thanks for the response.</div><div><br></div><div>Would it be acceptable in the Drupal community for me to solve this problem by creating a user0 object, switching it with the global $user, perform the test, and then switch back? &nbsp;By acceptable I mean are there any significant problems I shoud be aware of if using this approach?</div><div><br></div><div>Thanks again,<br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="font-size: medium; "><span class="Apple-style-span" style="font-size: 12px; "><div>Everett Zufelt<br></div><div><a href="http://zufelt.ca">http://zufelt.ca</a></div><div><br></div><div>Follow me on Twitter<br><a href="http://twitter.com/ezufelt">http://twitter.com/ezufelt</a><br><br>View my LinkedIn Profile<br><a href="http://www.linkedin.com/in/ezufelt">http://www.linkedin.com/in/ezufelt</a></div><div><br></div></span></span></div></div></span></div></span></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On 2010-04-23, at 6:12 PM, Jennifer Hodgdon wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>E.J. Zufelt wrote:<br><blockquote type="cite">I notice that menu_get_item() will tell me if the current user can access the current menu item. &nbsp;Is there a simple method to test if user0 can access the current menu item? &nbsp;That is, regardless who the current user is, I would like to see if there is a function to let me know if user0 can access the current page, essentially a test to see if the current page is available to anonymous users or not.<br></blockquote><br>I don't think there's an easy way. The access checking for menu_get_item() is done in _menu_check_access(). This figures out and calls the access callback for the particular menu item. For the most general case of a menu item with a custom access callback, it would probably not be possible to modify the function to check a specific $account instead of the current global $user, without some sort of hack.<br><br> &nbsp;&nbsp;--Jennifer<br><br>-- <br>Jennifer Hodgdon * Poplar ProductivityWare<br><a href="http://www.poplarware.com">www.poplarware.com</a><br>Drupal, WordPress, and custom Web programming<br><br></div></blockquote></div><br></div></body></html>