Made superuser able to have a separate "superuser character" in order to be able to have also test-characters without privileges.

This commit is contained in:
Griatch 2013-03-11 22:01:52 +01:00
parent bbdf2e0896
commit 7581d65cb3
4 changed files with 31 additions and 23 deletions

View file

@ -259,9 +259,10 @@ class LockHandler(object):
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)
"""
self.lock_bypass = ((hasattr(obj, "is_superuser") and obj.is_superuser)
or (hasattr(obj, "player") and hasattr(obj.player, "is_superuser") and obj.player.is_superuser)
or (hasattr(obj, "get_player") and (not obj.get_player() or obj.get_player().is_superuser)))
self.lock_bypass = (hasattr(obj, "is_superuser") and obj.is_superuser
or ((hasattr(obj, "get_attribute") and obj.get_attribute("_superuser_character"))
and ((hasattr(obj, "player") and hasattr(obj.player, "is_superuser") and obj.player.is_superuser)
or (hasattr(obj, "get_player") and (not obj.get_player() or obj.get_player().is_superuser)))))
def add(self, lockstring, log_obj=None):
"""