Guardian
has two verrrry similarly named predicates: anonymous?
and is_anonymous?
What is the difference?
Guardian
has two verrrry similarly named predicates: anonymous?
and is_anonymous?
What is the difference?
I agree, this can be confusing.
anonymous?
means that the user hasn’t logged in, so it’s an anonymous user browsing the site.
There’s an old feature that allows users to switch to an “anonymous” user account. Using anonymous mode to reply or create topics
is_anonymous?
means that the user has switched into that mode.
Ah-ha…
Perhaps it would be better to rename is_anonymous?
to is_user_in_anonymous_mode?
?
I guarantee there is at least one permissions-related bug already hiding in the codebase because someone mistakenly used the wrong method…