I am using the context module and have the masquerade block set to display in a region in the sitewide context so it will always show. Only the admin has privileges to masquerade block visibility has roles set to default (administraators). I am pretty sure context does not respect this role visibility, so it should show at all times in any event. (but I also tested using the default block system with the same results).

Anyway, when I masquerade as any user except Anonymous, the masquerade block remains visible and the navigation menu block shows the switch link to go back to admin role.

But when I masquerade as Anonymous, the masquerade block goes away, as does the navigation menu, and I am left with just the login block.

So essentially, all i did was log off with no way to get back as admin except to log back in as that role?


JSCSJSCS’s picture

I don't understand it , but have made some progress, at least in figuring out what the differences are.
I have a local development laptop that works as expected (i did not realize) and a live site that is simply a pulled git repo version of the laptop dev site.

The live website has the problem. When I select to masquerade as Anonymous, the masquerade block disappears and I am only left with the login block to get back.

However n the development laptop, when I do the same, the masquerade block remains!

I am at a loss as to why this is, given it is supposed to be identical.

The other users that I masquerade as work as expected. Just anonymous is messed up.

JSCSJSCS’s picture

Category: support » bug

Maybe this is a bug?

wjaspers’s picture

Category: bug » support

What's happening is that the "anonymous" masquerade removes "authenticated" permissions from the active global $user.
The resulting side-effect is the inability to see specific blocks or content that is controlled by user role visibility.

I'm willing to bet, the default block provided by Masquerade is either not placed anywhere, or has specific visibility settings enabled that are preventing it from being displayed when you masquerade as "anonymous".

stuzog’s picture

I'm experiencing a variant of this as I do not have the Navigation menu visible in my theme. I moved the two Masquerade menus to the Management menu where they are visible to users with Administrator permissions. However, the role I wish to masquerade as does not have Administrator permissions, so when I masquerade as this role, Admin Menu disappears, so the only way I can switch back is to log out as that user and log in again as Administrator.

The only way around this that I can see is to allow that role to function as an Administrator in Masquerade, which I don't want todo on a live site.

Any other ideas? Am I misunderstanding ow Masquerade works?

deekayen’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

If you want to be anonymous, logout. Any remnants of anonymous masquerading ability are getting removed in 8.x.