WL-2499 - Fixing exception thrown by clearPublicAccess because it will not be possible to see an Inconsistent Exception when the anon role is always defined, but it will be possible to get a permission exception.
WL-2499 removed superfluous null check.
WL-2499 introduced check that the userid is not actually "dummy" to prevent an out of bounds exception.