Improved lock-setting logic to handle empty locks, and allow customizing locks via .create()'s new generate_default_locks

This commit is contained in:
Andrew Bastien 2023-11-25 18:09:30 -05:00
parent e2a7c54e24
commit a0907ec94d
3 changed files with 118 additions and 30 deletions

View file

@ -277,6 +277,12 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
# Used by account.create_character() to choose default typeclass for characters.
default_character_typeclass = settings.BASE_CHARACTER_TYPECLASS
lockstring = (
"examine:perm(Admin);edit:perm(Admin);"
"delete:perm(Admin);boot:perm(Admin);msg:all();"
"noidletimeout:perm(Builder) or perm(noidletimeout)"
)
# properties
@lazy_property
def cmdset(self):
@ -1399,12 +1405,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
"""
# A basic security setup
lockstring = (
"examine:perm(Admin);edit:perm(Admin);"
"delete:perm(Admin);boot:perm(Admin);msg:all();"
"noidletimeout:perm(Builder) or perm(noidletimeout)"
)
self.locks.add(lockstring)
self.locks.add(self.lockstring)
# The ooc account cmdset
self.cmdset.add_default(_CMDSET_ACCOUNT, persistent=True)