'We cache superuser bypass checks here for efficiency. This
needs to be re-run when a player is assigned to a character.
We need to grant access to superusers. We need to check both
directly on the object (players), through obj.player and using
the get_player() method (this sits on serversessions, in some
rare cases where a check is done before the login process has
yet been fully finalized)
Args:
obj (object): This is checked for the `is_superuser` property.'

def cache_lock_bypass(self, obj):

    self.lock_bypass = (hasattr(obj, 'is_superuser') and obj.is_superuser)
