<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Good afternoon Adam,<div><br></div><div>I had a similar question, a while back, here is the answer I received.</div><div><br></div><div>In short, no, there is no good approach to this :)</div><div><br></div><div><br></div><div>If you do go down the path of changing the global $user object, then</div><div>you will want to use session_save_session to make your code look<br>something like this:<br><br>// Don't save the session if the next block of code fails:<br>session_save_session(FALSE);<br>// Save the old user account someplace.<br><br>$user = user_load(0);<br>// Some computation....<br><br>// Something like this:<br>$user = $the_old_user<br><br>// Its now safe to start saving the session again:<br>session_save_session(TRUE);<br><br></code><br><br>If your 'Computation' in the middle there fails, then the users<br>session will be saved with the $user object you loaded up, i.e.<br>they'll get logged out. Annoying at the moment, but if you ever change<br>it to assign other users to the $user object then you might end up<br>with people being logged in as other people if the 'computation' fails<br>for some reason.<br><br><div><br class="webkit-block-placeholder"></div><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-09-20, at 1:07 PM, Adam B. Ross wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello all,<br><br>I am trying to determine a good approach to identifying whether a<br>specified menu path could be accessed by anonymous users, in an effort<br>to implement some kind of baseline cacheable security for an Input<br>Filter.<br><br>However, I cannot specify a user with such functions as<br>menu_get_item() to ask for the access right of an anonymous user. Is<br>there a good approach to this?<br><br>- abr/Grayside<br></div></blockquote></div><br></div></body></html>