Fix lingering references to old perms/locks to resolve unittests.
This commit is contained in:
parent
2138e4cd70
commit
8ee817ce8b
8 changed files with 14 additions and 14 deletions
|
|
@ -2625,7 +2625,7 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS):
|
||||||
return
|
return
|
||||||
elif isinstance(prototype, dict):
|
elif isinstance(prototype, dict):
|
||||||
# we got the prototype on the command line. We must make sure to not allow
|
# we got the prototype on the command line. We must make sure to not allow
|
||||||
# the 'exec' key unless we are immortals or higher.
|
# the 'exec' key unless we are developers or higher.
|
||||||
if "exec" in prototype and not self.caller.check_permstring("Developer"):
|
if "exec" in prototype and not self.caller.check_permstring("Developer"):
|
||||||
self.caller.msg("Spawn aborted: You don't have access to use the 'exec' prototype key.")
|
self.caller.msg("Spawn aborted: You don't have access to use the 'exec' prototype key.")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ class CmdCharCreate(COMMAND_DEFAULT_CLASS):
|
||||||
location=start_location,
|
location=start_location,
|
||||||
home=default_home,
|
home=default_home,
|
||||||
permissions=permissions)
|
permissions=permissions)
|
||||||
# only allow creator (and immortals) to puppet this char
|
# only allow creator (and developers) to puppet this char
|
||||||
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Developer) or pperm(Developer)" %
|
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Developer) or pperm(Developer)" %
|
||||||
(new_character.id, player.id))
|
(new_character.id, player.id))
|
||||||
player.db._playable_characters.append(new_character)
|
player.db._playable_characters.append(new_character)
|
||||||
|
|
@ -403,7 +403,7 @@ class CmdWho(COMMAND_DEFAULT_CLASS):
|
||||||
if self.cmdstring == "doing":
|
if self.cmdstring == "doing":
|
||||||
show_session_data = False
|
show_session_data = False
|
||||||
else:
|
else:
|
||||||
show_session_data = player.check_permstring("Developer") or player.check_permstring("Wizards")
|
show_session_data = player.check_permstring("Developer") or player.check_permstring("Admins")
|
||||||
|
|
||||||
nplayers = (SESSIONS.player_count())
|
nplayers = (SESSIONS.player_count())
|
||||||
if show_session_data:
|
if show_session_data:
|
||||||
|
|
|
||||||
|
|
@ -156,8 +156,8 @@ class TestAdmin(CommandTest):
|
||||||
self.call(admin.CmdEmit(), "Char2 = Test", "Emitted to Char2:\nTest")
|
self.call(admin.CmdEmit(), "Char2 = Test", "Emitted to Char2:\nTest")
|
||||||
|
|
||||||
def test_perm(self):
|
def test_perm(self):
|
||||||
self.call(admin.CmdPerm(), "Obj = Builders", "Permission 'Builders' given to Obj (the Object/Character).")
|
self.call(admin.CmdPerm(), "Obj = Builder", "Permission 'Builder' given to Obj (the Object/Character).")
|
||||||
self.call(admin.CmdPerm(), "Char2 = Builders", "Permission 'Builders' given to Char2 (the Object/Character).")
|
self.call(admin.CmdPerm(), "Char2 = Builder", "Permission 'Builder' given to Char2 (the Object/Character).")
|
||||||
|
|
||||||
def test_wall(self):
|
def test_wall(self):
|
||||||
self.call(admin.CmdWall(), "Test", "Announcing to all connected players ...")
|
self.call(admin.CmdWall(), "Test", "Announcing to all connected players ...")
|
||||||
|
|
@ -203,7 +203,7 @@ class TestPlayer(CommandTest):
|
||||||
self.call(player.CmdCharCreate(), "Test1=Test char", "Created new character Test1. Use @ic Test1 to enter the game", caller=self.player)
|
self.call(player.CmdCharCreate(), "Test1=Test char", "Created new character Test1. Use @ic Test1 to enter the game", caller=self.player)
|
||||||
|
|
||||||
def test_quell(self):
|
def test_quell(self):
|
||||||
self.call(player.CmdQuell(), "", "Quelling to current puppet's permissions (immortals).", caller=self.player)
|
self.call(player.CmdQuell(), "", "Quelling to current puppet's permissions (developer).", caller=self.player)
|
||||||
|
|
||||||
|
|
||||||
class TestBuilding(CommandTest):
|
class TestBuilding(CommandTest):
|
||||||
|
|
|
||||||
|
|
@ -1203,7 +1203,7 @@ class ContribRPObject(DefaultObject):
|
||||||
nofound_string (str): optional custom string for not-found error message.
|
nofound_string (str): optional custom string for not-found error message.
|
||||||
multimatch_string (str): optional custom string for multimatch error header.
|
multimatch_string (str): optional custom string for multimatch error header.
|
||||||
use_dbref (bool or None): If None, only turn off use_dbref if we are of a lower
|
use_dbref (bool or None): If None, only turn off use_dbref if we are of a lower
|
||||||
permission than Builders. Otherwise, honor the True/False value.
|
permission than Builder. Otherwise, honor the True/False value.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
match (Object, None or list): will return an Object/None if `quiet=False`,
|
match (Object, None or list): will return an Object/None if `quiet=False`,
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ class PlayerForm(forms.ModelForm):
|
||||||
help_text="In-game permissions. A comma-separated list of text "
|
help_text="In-game permissions. A comma-separated list of text "
|
||||||
"strings checked by certain locks. They are often used for "
|
"strings checked by certain locks. They are often used for "
|
||||||
"hierarchies, such as letting a Player have permission "
|
"hierarchies, such as letting a Player have permission "
|
||||||
"'Wizards', 'Builders' etc. A Player permission can be "
|
"'Admin', 'Builder' etc. A Player permission can be "
|
||||||
"overloaded by the permissions of a controlled Character. "
|
"overloaded by the permissions of a controlled Character. "
|
||||||
"Normal players use 'Players' by default.")
|
"Normal players use 'Players' by default.")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ full step-by-step setup help.
|
||||||
Basically (for testing default Evennia):
|
Basically (for testing default Evennia):
|
||||||
|
|
||||||
- Use an empty/testing database.
|
- Use an empty/testing database.
|
||||||
- set PERMISSION_PLAYER_DEFAULT = "Builders"
|
- set PERMISSION_PLAYER_DEFAULT = "Builder"
|
||||||
- start server, eventually with profiling active
|
- start server, eventually with profiling active
|
||||||
- launch this client runner
|
- launch this client runner
|
||||||
|
|
||||||
|
|
@ -95,7 +95,7 @@ ERROR_NO_MIXIN = \
|
||||||
from evennia.server.profiling.settings_mixin import *
|
from evennia.server.profiling.settings_mixin import *
|
||||||
|
|
||||||
This will change the settings in the following way:
|
This will change the settings in the following way:
|
||||||
- change PERMISSION_PLAYER_DEFAULT to 'Immortals' to allow clients
|
- change PERMISSION_PLAYER_DEFAULT to 'Developer' to allow clients
|
||||||
to test all commands
|
to test all commands
|
||||||
- change PASSWORD_HASHERS to use a faster (but less safe) algorithm
|
- change PASSWORD_HASHERS to use a faster (but less safe) algorithm
|
||||||
when creating large numbers of accounts at the same time
|
when creating large numbers of accounts at the same time
|
||||||
|
|
@ -136,7 +136,7 @@ Setup:
|
||||||
`evennia migrate`)
|
`evennia migrate`)
|
||||||
2) in server/conf/settings.py, add
|
2) in server/conf/settings.py, add
|
||||||
|
|
||||||
PERMISSION_PLAYER_DEFAULT="Builders"
|
PERMISSION_PLAYER_DEFAULT="Builder"
|
||||||
|
|
||||||
This is so that the dummy players can test building operations.
|
This is so that the dummy players can test building operations.
|
||||||
You can also customize the dummyrunner by modifying a setting
|
You can also customize the dummyrunner by modifying a setting
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,4 @@ PASSWORD_HASHERS = (
|
||||||
'django.contrib.auth.hashers.MD5PasswordHasher',
|
'django.contrib.auth.hashers.MD5PasswordHasher',
|
||||||
)
|
)
|
||||||
# make dummy clients able to test all commands
|
# make dummy clients able to test all commands
|
||||||
PERMISSION_PLAYER_DEFAULT = "Immortals"
|
PERMISSION_PLAYER_DEFAULT = "Developer"
|
||||||
|
|
|
||||||
|
|
@ -39,14 +39,14 @@ class EvenniaTest(TestCase):
|
||||||
self.obj1 = create.create_object(self.object_typeclass, key="Obj", location=self.room1, home=self.room1)
|
self.obj1 = create.create_object(self.object_typeclass, key="Obj", location=self.room1, home=self.room1)
|
||||||
self.obj2 = create.create_object(self.object_typeclass, key="Obj2", location=self.room1, home=self.room1)
|
self.obj2 = create.create_object(self.object_typeclass, key="Obj2", location=self.room1, home=self.room1)
|
||||||
self.char1 = create.create_object(self.character_typeclass, key="Char", location=self.room1, home=self.room1)
|
self.char1 = create.create_object(self.character_typeclass, key="Char", location=self.room1, home=self.room1)
|
||||||
self.char1.permissions.add("Immortals")
|
self.char1.permissions.add("Developer")
|
||||||
self.char2 = create.create_object(self.character_typeclass, key="Char2", location=self.room1, home=self.room1)
|
self.char2 = create.create_object(self.character_typeclass, key="Char2", location=self.room1, home=self.room1)
|
||||||
self.char1.player = self.player
|
self.char1.player = self.player
|
||||||
self.player.db._last_puppet = self.char1
|
self.player.db._last_puppet = self.char1
|
||||||
self.char2.player = self.player2
|
self.char2.player = self.player2
|
||||||
self.player2.db._last_puppet = self.char2
|
self.player2.db._last_puppet = self.char2
|
||||||
self.script = create.create_script(self.script_typeclass, key="Script")
|
self.script = create.create_script(self.script_typeclass, key="Script")
|
||||||
self.player.permissions.add("Immortals")
|
self.player.permissions.add("Developer")
|
||||||
|
|
||||||
# set up a fake session
|
# set up a fake session
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue