Change permission strings so Immortals->Developer, Wizards->Admin, Builders->Builder, PlayerHelper->Helper, Players->Player, Guests->Guest. Made perm() and pperm() lock function accept both the plural and singular form (so both Admin and Admins work). Still lacking a data migration for updating an existing database to the new setup.
This commit is contained in:
parent
edc092bfc4
commit
0bd47f0c52
23 changed files with 119 additions and 118 deletions
|
|
@ -36,7 +36,7 @@ class CmdBoot(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@boot"
|
key = "@boot"
|
||||||
locks = "cmd:perm(boot) or perm(Wizards)"
|
locks = "cmd:perm(boot) or perm(Admin)"
|
||||||
help_category = "Admin"
|
help_category = "Admin"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -152,7 +152,7 @@ class CmdBan(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@ban"
|
key = "@ban"
|
||||||
aliases = ["@bans"]
|
aliases = ["@bans"]
|
||||||
locks = "cmd:perm(ban) or perm(Immortals)"
|
locks = "cmd:perm(ban) or perm(Developer)"
|
||||||
help_category = "Admin"
|
help_category = "Admin"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -219,7 +219,7 @@ class CmdUnban(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "@unban"
|
key = "@unban"
|
||||||
locks = "cmd:perm(unban) or perm(Immortals)"
|
locks = "cmd:perm(unban) or perm(Developer)"
|
||||||
help_category = "Admin"
|
help_category = "Admin"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -266,7 +266,7 @@ class CmdDelPlayer(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@delplayer"
|
key = "@delplayer"
|
||||||
locks = "cmd:perm(delplayer) or perm(Immortals)"
|
locks = "cmd:perm(delplayer) or perm(Developer)"
|
||||||
help_category = "Admin"
|
help_category = "Admin"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -342,7 +342,7 @@ class CmdEmit(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@emit"
|
key = "@emit"
|
||||||
aliases = ["@pemit", "@remit"]
|
aliases = ["@pemit", "@remit"]
|
||||||
locks = "cmd:perm(emit) or perm(Builders)"
|
locks = "cmd:perm(emit) or perm(Builder)"
|
||||||
help_category = "Admin"
|
help_category = "Admin"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -410,7 +410,7 @@ class CmdNewPassword(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@userpassword"
|
key = "@userpassword"
|
||||||
locks = "cmd:perm(newpassword) or perm(Wizards)"
|
locks = "cmd:perm(newpassword) or perm(Admin)"
|
||||||
help_category = "Admin"
|
help_category = "Admin"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -451,7 +451,7 @@ class CmdPerm(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@perm"
|
key = "@perm"
|
||||||
aliases = "@setperm"
|
aliases = "@setperm"
|
||||||
locks = "cmd:perm(perm) or perm(Immortals)"
|
locks = "cmd:perm(perm) or perm(Developer)"
|
||||||
help_category = "Admin"
|
help_category = "Admin"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -546,7 +546,7 @@ class CmdWall(COMMAND_DEFAULT_CLASS):
|
||||||
Announces a message to all connected players.
|
Announces a message to all connected players.
|
||||||
"""
|
"""
|
||||||
key = "@wall"
|
key = "@wall"
|
||||||
locks = "cmd:perm(wall) or perm(Wizards)"
|
locks = "cmd:perm(wall) or perm(Admin)"
|
||||||
help_category = "Admin"
|
help_category = "Admin"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
|
||||||
|
|
@ -239,7 +239,7 @@ class CmdBatchCommands(_COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@batchcommands"
|
key = "@batchcommands"
|
||||||
aliases = ["@batchcommand", "@batchcmd"]
|
aliases = ["@batchcommand", "@batchcmd"]
|
||||||
locks = "cmd:perm(batchcommands) or superuser()"
|
locks = "cmd:perm(batchcommands) or perm(Developer)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class CmdSetObjAlias(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@alias"
|
key = "@alias"
|
||||||
aliases = "@setobjalias"
|
aliases = "@setobjalias"
|
||||||
locks = "cmd:perm(setobjalias) or perm(Builders)"
|
locks = "cmd:perm(setobjalias) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -196,7 +196,7 @@ class CmdCopy(ObjManipCommand):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@copy"
|
key = "@copy"
|
||||||
locks = "cmd:perm(copy) or perm(Builders)"
|
locks = "cmd:perm(copy) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -276,7 +276,7 @@ class CmdCpAttr(ObjManipCommand):
|
||||||
If you don't supply a source object, yourself is used.
|
If you don't supply a source object, yourself is used.
|
||||||
"""
|
"""
|
||||||
key = "@cpattr"
|
key = "@cpattr"
|
||||||
locks = "cmd:perm(cpattr) or perm(Builders)"
|
locks = "cmd:perm(cpattr) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def check_from_attr(self, obj, attr, clear=False):
|
def check_from_attr(self, obj, attr, clear=False):
|
||||||
|
|
@ -418,7 +418,7 @@ class CmdMvAttr(ObjManipCommand):
|
||||||
object. If you don't supply a source object, yourself is used.
|
object. If you don't supply a source object, yourself is used.
|
||||||
"""
|
"""
|
||||||
key = "@mvattr"
|
key = "@mvattr"
|
||||||
locks = "cmd:perm(mvattr) or perm(Builders)"
|
locks = "cmd:perm(mvattr) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -466,12 +466,12 @@ class CmdCreate(ObjManipCommand):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@create"
|
key = "@create"
|
||||||
locks = "cmd:perm(create) or perm(Builders)"
|
locks = "cmd:perm(create) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
# lockstring of newly created objects, for easy overloading.
|
# lockstring of newly created objects, for easy overloading.
|
||||||
# Will be formatted with the {id} of the creating object.
|
# Will be formatted with the {id} of the creating object.
|
||||||
new_obj_lockstring = "control:id({id}) or perm(Wizards);delete:id({id}) or perm(Wizards)"
|
new_obj_lockstring = "control:id({id}) or perm(Admin);delete:id({id}) or perm(Admin)"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -548,7 +548,7 @@ class CmdDesc(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@setdesc"
|
key = "@setdesc"
|
||||||
aliases = "@describe"
|
aliases = "@describe"
|
||||||
locks = "cmd:perm(desc) or perm(Builders)"
|
locks = "cmd:perm(desc) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def edit_handler(self):
|
def edit_handler(self):
|
||||||
|
|
@ -616,7 +616,7 @@ class CmdDestroy(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@destroy"
|
key = "@destroy"
|
||||||
aliases = ["@delete", "@del"]
|
aliases = ["@delete", "@del"]
|
||||||
locks = "cmd:perm(destroy) or perm(Builders)"
|
locks = "cmd:perm(destroy) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -701,14 +701,14 @@ class CmdDig(ObjManipCommand):
|
||||||
would be 'north;no;n'.
|
would be 'north;no;n'.
|
||||||
"""
|
"""
|
||||||
key = "@dig"
|
key = "@dig"
|
||||||
locks = "cmd:perm(dig) or perm(Builders)"
|
locks = "cmd:perm(dig) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
# lockstring of newly created rooms, for easy overloading.
|
# lockstring of newly created rooms, for easy overloading.
|
||||||
# Will be formatted with the {id} of the creating object.
|
# Will be formatted with the {id} of the creating object.
|
||||||
new_room_lockstring = "control:id({id}) or perm(Wizards); " \
|
new_room_lockstring = "control:id({id}) or perm(Admin); " \
|
||||||
"delete:id({id}) or perm(Wizards); " \
|
"delete:id({id}) or perm(Admin); " \
|
||||||
"edit:id({id}) or perm(Wizards)"
|
"edit:id({id}) or perm(Admin)"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
"Do the digging. Inherits variables from ObjManipCommand.parse()"
|
"Do the digging. Inherits variables from ObjManipCommand.parse()"
|
||||||
|
|
@ -845,7 +845,7 @@ class CmdTunnel(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@tunnel"
|
key = "@tunnel"
|
||||||
aliases = ["@tun"]
|
aliases = ["@tun"]
|
||||||
locks = "cmd: perm(tunnel) or perm(Builders)"
|
locks = "cmd: perm(tunnel) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
# store the direction, full name and its opposite
|
# store the direction, full name and its opposite
|
||||||
|
|
@ -918,7 +918,7 @@ class CmdLink(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@link"
|
key = "@link"
|
||||||
locks = "cmd:perm(link) or perm(Builders)"
|
locks = "cmd:perm(link) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -996,7 +996,7 @@ class CmdUnLink(CmdLink):
|
||||||
# this is just a child of CmdLink
|
# this is just a child of CmdLink
|
||||||
|
|
||||||
key = "@unlink"
|
key = "@unlink"
|
||||||
locks = "cmd:perm(unlink) or perm(Builders)"
|
locks = "cmd:perm(unlink) or perm(Builder)"
|
||||||
help_key = "Building"
|
help_key = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -1034,7 +1034,7 @@ class CmdSetHome(CmdLink):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@sethome"
|
key = "@sethome"
|
||||||
locks = "cmd:perm(@home) or perm(Builders)"
|
locks = "cmd:perm(@home) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -1081,7 +1081,7 @@ class CmdListCmdSets(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@cmdsets"
|
key = "@cmdsets"
|
||||||
aliases = "@listcmsets"
|
aliases = "@listcmsets"
|
||||||
locks = "cmd:perm(listcmdsets) or perm(Builders)"
|
locks = "cmd:perm(listcmdsets) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -1112,7 +1112,7 @@ class CmdName(ObjManipCommand):
|
||||||
|
|
||||||
key = "@name"
|
key = "@name"
|
||||||
aliases = ["@rename"]
|
aliases = ["@rename"]
|
||||||
locks = "cmd:perm(rename) or perm(Builders)"
|
locks = "cmd:perm(rename) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -1188,7 +1188,7 @@ class CmdOpen(ObjManipCommand):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "@open"
|
key = "@open"
|
||||||
locks = "cmd:perm(open) or perm(Builders)"
|
locks = "cmd:perm(open) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
# a custom member method to chug out exits and do checks
|
# a custom member method to chug out exits and do checks
|
||||||
|
|
@ -1410,7 +1410,7 @@ class CmdSetAttribute(ObjManipCommand):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@set"
|
key = "@set"
|
||||||
locks = "cmd:perm(set) or perm(Builders)"
|
locks = "cmd:perm(set) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def check_obj(self, obj):
|
def check_obj(self, obj):
|
||||||
|
|
@ -1592,7 +1592,7 @@ class CmdTypeclass(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@typeclass"
|
key = "@typeclass"
|
||||||
aliases = ["@type", "@parent", "@swap", "@update"]
|
aliases = ["@type", "@parent", "@swap", "@update"]
|
||||||
locks = "cmd:perm(typeclass) or perm(Builders)"
|
locks = "cmd:perm(typeclass) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -1682,7 +1682,7 @@ class CmdWipe(ObjManipCommand):
|
||||||
matching the given attribute-wildcard search string.
|
matching the given attribute-wildcard search string.
|
||||||
"""
|
"""
|
||||||
key = "@wipe"
|
key = "@wipe"
|
||||||
locks = "cmd:perm(wipe) or perm(Builders)"
|
locks = "cmd:perm(wipe) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -1740,18 +1740,18 @@ class CmdLock(ObjManipCommand):
|
||||||
Separator expressions need not be capitalized.
|
Separator expressions need not be capitalized.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
'get: id(25) or perm(Wizards)'
|
'get: id(25) or perm(Admin)'
|
||||||
The 'get' access_type is checked by the get command and will
|
The 'get' access_type is checked by the get command and will
|
||||||
an object locked with this string will only be possible to
|
an object locked with this string will only be possible to
|
||||||
pick up by Wizards or by object with id 25.
|
pick up by Admins or by object with id=25.
|
||||||
|
|
||||||
You can add several access_types after oneanother by separating
|
You can add several access_types after oneanother by separating
|
||||||
them by ';', i.e:
|
them by ';', i.e:
|
||||||
'get:id(25);delete:perm(Builders)'
|
'get:id(25);delete:perm(Builder)'
|
||||||
"""
|
"""
|
||||||
key = "@lock"
|
key = "@lock"
|
||||||
aliases = ["@locks"]
|
aliases = ["@locks"]
|
||||||
locks = "cmd: perm(locks) or perm(Builders)"
|
locks = "cmd: perm(locks) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -1844,7 +1844,7 @@ class CmdExamine(ObjManipCommand):
|
||||||
"""
|
"""
|
||||||
key = "@examine"
|
key = "@examine"
|
||||||
aliases = ["@ex","exam"]
|
aliases = ["@ex","exam"]
|
||||||
locks = "cmd:perm(examine) or perm(Builders)"
|
locks = "cmd:perm(examine) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
arg_regex = r"(/\w+?(\s|$))|\s|$"
|
arg_regex = r"(/\w+?(\s|$))|\s|$"
|
||||||
|
|
||||||
|
|
@ -2113,7 +2113,7 @@ class CmdFind(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@find"
|
key = "@find"
|
||||||
aliases = "@search, @locate"
|
aliases = "@search, @locate"
|
||||||
locks = "cmd:perm(find) or perm(Builders)"
|
locks = "cmd:perm(find) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -2244,7 +2244,7 @@ class CmdTeleport(COMMAND_DEFAULT_CLASS):
|
||||||
is teleported to the target location. """
|
is teleported to the target location. """
|
||||||
key = "@tel"
|
key = "@tel"
|
||||||
aliases = "@teleport"
|
aliases = "@teleport"
|
||||||
locks = "cmd:perm(teleport) or perm(Builders)"
|
locks = "cmd:perm(teleport) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -2343,7 +2343,7 @@ class CmdScript(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@script"
|
key = "@script"
|
||||||
aliases = "@addscript"
|
aliases = "@addscript"
|
||||||
locks = "cmd:perm(script) or perm(Builders)"
|
locks = "cmd:perm(script) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -2444,7 +2444,7 @@ class CmdTag(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@tag"
|
key = "@tag"
|
||||||
aliases = ["@tags"]
|
aliases = ["@tags"]
|
||||||
locks = "cmd:perm(tag) or perm(Builders)"
|
locks = "cmd:perm(tag) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
arg_regex = r"(/\w+?(\s|$))|\s|$"
|
arg_regex = r"(/\w+?(\s|$))|\s|$"
|
||||||
|
|
||||||
|
|
@ -2584,7 +2584,7 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@spawn"
|
key = "@spawn"
|
||||||
locks = "cmd:perm(spawn) or perm(Builders)"
|
locks = "cmd:perm(spawn) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -2626,7 +2626,7 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS):
|
||||||
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 immortals or higher.
|
||||||
if "exec" in prototype and not self.caller.check_permstring("Immortals"):
|
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
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -453,7 +453,7 @@ class CmdCemit(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@cemit"
|
key = "@cemit"
|
||||||
aliases = ["@cmsg"]
|
aliases = ["@cmsg"]
|
||||||
locks = "cmd: not pperm(channel_banned) and pperm(Players)"
|
locks = "cmd: not pperm(channel_banned) and pperm(Player)"
|
||||||
help_category = "Comms"
|
help_category = "Comms"
|
||||||
|
|
||||||
# this is used by the COMMAND_DEFAULT_CLASS parent
|
# this is used by the COMMAND_DEFAULT_CLASS parent
|
||||||
|
|
@ -530,7 +530,7 @@ class CmdChannelCreate(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@ccreate"
|
key = "@ccreate"
|
||||||
aliases = "channelcreate"
|
aliases = "channelcreate"
|
||||||
locks = "cmd:not pperm(channel_banned) and pperm(Players)"
|
locks = "cmd:not pperm(channel_banned) and pperm(Player)"
|
||||||
help_category = "Comms"
|
help_category = "Comms"
|
||||||
|
|
||||||
# this is used by the COMMAND_DEFAULT_CLASS parent
|
# this is used by the COMMAND_DEFAULT_CLASS parent
|
||||||
|
|
@ -850,7 +850,7 @@ class CmdIRC2Chan(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@irc2chan"
|
key = "@irc2chan"
|
||||||
locks = "cmd:serversetting(IRC_ENABLED) and pperm(Immortals)"
|
locks = "cmd:serversetting(IRC_ENABLED) and pperm(Developer)"
|
||||||
help_category = "Comms"
|
help_category = "Comms"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -943,7 +943,7 @@ class CmdIRCStatus(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "@ircstatus"
|
key = "@ircstatus"
|
||||||
locks = "cmd:serversetting(IRC_ENABLED) and perm(ircstatus) or perm(Builders))"
|
locks = "cmd:serversetting(IRC_ENABLED) and perm(ircstatus) or perm(Builder))"
|
||||||
help_category = "Comms"
|
help_category = "Comms"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -981,7 +981,7 @@ class CmdIRCStatus(COMMAND_DEFAULT_CLASS):
|
||||||
# an asynchronous call.
|
# an asynchronous call.
|
||||||
self.caller.msg("Requesting nicklist from %s (%s:%s)." % (channel, network, port))
|
self.caller.msg("Requesting nicklist from %s (%s:%s)." % (channel, network, port))
|
||||||
ircbot.get_nicklist(self.caller)
|
ircbot.get_nicklist(self.caller)
|
||||||
elif self.caller.locks.check_lockstring(self.caller, "dummy:perm(ircstatus) or perm(Immortals)"):
|
elif self.caller.locks.check_lockstring(self.caller, "dummy:perm(ircstatus) or perm(Developer)"):
|
||||||
# reboot the client
|
# reboot the client
|
||||||
self.caller.msg("Forcing a disconnect + reconnect of %s." % chtext)
|
self.caller.msg("Forcing a disconnect + reconnect of %s." % chtext)
|
||||||
ircbot.reconnect()
|
ircbot.reconnect()
|
||||||
|
|
@ -1016,7 +1016,7 @@ class CmdRSS2Chan(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@rss2chan"
|
key = "@rss2chan"
|
||||||
locks = "cmd:serversetting(RSS_ENABLED) and pperm(Immortals)"
|
locks = "cmd:serversetting(RSS_ENABLED) and pperm(Developer)"
|
||||||
help_category = "Comms"
|
help_category = "Comms"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class CmdHome(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "home"
|
key = "home"
|
||||||
locks = "cmd:perm(home) or perm(Builders)"
|
locks = "cmd:perm(home) or perm(Builder)"
|
||||||
arg_regex = r"$"
|
arg_regex = r"$"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ class CmdSetHelp(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "@sethelp"
|
key = "@sethelp"
|
||||||
locks = "cmd:perm(PlayerHelpers)"
|
locks = "cmd:perm(Helper)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ class CmdCharCreate(COMMAND_DEFAULT_CLASS):
|
||||||
if you want.
|
if you want.
|
||||||
"""
|
"""
|
||||||
key = "@charcreate"
|
key = "@charcreate"
|
||||||
locks = "cmd:pperm(Players)"
|
locks = "cmd:pperm(Player)"
|
||||||
help_category = "General"
|
help_category = "General"
|
||||||
|
|
||||||
# this is used by the parent
|
# this is used by the parent
|
||||||
|
|
@ -164,7 +164,7 @@ class CmdCharCreate(COMMAND_DEFAULT_CLASS):
|
||||||
home=default_home,
|
home=default_home,
|
||||||
permissions=permissions)
|
permissions=permissions)
|
||||||
# only allow creator (and immortals) to puppet this char
|
# only allow creator (and immortals) to puppet this char
|
||||||
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Immortals) or pperm(Immortals)" %
|
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)
|
||||||
if desc:
|
if desc:
|
||||||
|
|
@ -184,7 +184,7 @@ class CmdCharDelete(COMMAND_DEFAULT_CLASS):
|
||||||
Permanently deletes one of your characters.
|
Permanently deletes one of your characters.
|
||||||
"""
|
"""
|
||||||
key = "@chardelete"
|
key = "@chardelete"
|
||||||
locks = "cmd:pperm(Players)"
|
locks = "cmd:pperm(Player)"
|
||||||
help_category = "General"
|
help_category = "General"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -298,7 +298,7 @@ class CmdOOC(MuxPlayerLookCommand):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = "@ooc"
|
key = "@ooc"
|
||||||
locks = "cmd:pperm(Players)"
|
locks = "cmd:pperm(Player)"
|
||||||
aliases = "@unpuppet"
|
aliases = "@unpuppet"
|
||||||
help_category = "General"
|
help_category = "General"
|
||||||
|
|
||||||
|
|
@ -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("Immortals") or player.check_permstring("Wizards")
|
show_session_data = player.check_permstring("Developer") or player.check_permstring("Wizards")
|
||||||
|
|
||||||
nplayers = (SESSIONS.player_count())
|
nplayers = (SESSIONS.player_count())
|
||||||
if show_session_data:
|
if show_session_data:
|
||||||
|
|
@ -610,7 +610,7 @@ class CmdPassword(COMMAND_DEFAULT_CLASS):
|
||||||
Changes your password. Make sure to pick a safe one.
|
Changes your password. Make sure to pick a safe one.
|
||||||
"""
|
"""
|
||||||
key = "@password"
|
key = "@password"
|
||||||
locks = "cmd:pperm(Players)"
|
locks = "cmd:pperm(Player)"
|
||||||
|
|
||||||
# this is used by the parent
|
# this is used by the parent
|
||||||
player_caller = True
|
player_caller = True
|
||||||
|
|
@ -793,7 +793,7 @@ class CmdQuell(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@quell"
|
key = "@quell"
|
||||||
aliases = ["@unquell"]
|
aliases = ["@unquell"]
|
||||||
locks = "cmd:pperm(Players)"
|
locks = "cmd:pperm(Player)"
|
||||||
help_category = "General"
|
help_category = "General"
|
||||||
|
|
||||||
# this is used by the parent
|
# this is used by the parent
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class CmdReload(COMMAND_DEFAULT_CLASS):
|
||||||
@reset to purge) and at_reload() hooks will be called.
|
@reset to purge) and at_reload() hooks will be called.
|
||||||
"""
|
"""
|
||||||
key = "@reload"
|
key = "@reload"
|
||||||
locks = "cmd:perm(reload) or perm(Immortals)"
|
locks = "cmd:perm(reload) or perm(Developer)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -83,7 +83,7 @@ class CmdReset(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@reset"
|
key = "@reset"
|
||||||
aliases = ['@reboot']
|
aliases = ['@reboot']
|
||||||
locks = "cmd:perm(reload) or perm(Immortals)"
|
locks = "cmd:perm(reload) or perm(Developer)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -105,7 +105,7 @@ class CmdShutdown(COMMAND_DEFAULT_CLASS):
|
||||||
Gracefully shut down both Server and Portal.
|
Gracefully shut down both Server and Portal.
|
||||||
"""
|
"""
|
||||||
key = "@shutdown"
|
key = "@shutdown"
|
||||||
locks = "cmd:perm(shutdown) or perm(Immortals)"
|
locks = "cmd:perm(shutdown) or perm(Developer)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -240,7 +240,7 @@ class CmdPy(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@py"
|
key = "@py"
|
||||||
aliases = ["!"]
|
aliases = ["!"]
|
||||||
locks = "cmd:perm(py) or perm(Immortals)"
|
locks = "cmd:perm(py) or perm(Developer)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -322,7 +322,7 @@ class CmdScripts(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@scripts"
|
key = "@scripts"
|
||||||
aliases = ["@globalscript", "@listscripts"]
|
aliases = ["@globalscript", "@listscripts"]
|
||||||
locks = "cmd:perm(listscripts) or perm(Wizards)"
|
locks = "cmd:perm(listscripts) or perm(Admin)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -405,7 +405,7 @@ class CmdObjects(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@objects"
|
key = "@objects"
|
||||||
aliases = ["@listobjects", "@listobjs", '@stats', '@db']
|
aliases = ["@listobjects", "@listobjs", '@stats', '@db']
|
||||||
locks = "cmd:perm(listobjects) or perm(Builders)"
|
locks = "cmd:perm(listobjects) or perm(Builder)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -469,7 +469,7 @@ class CmdPlayers(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@players"
|
key = "@players"
|
||||||
aliases = ["@listplayers"]
|
aliases = ["@listplayers"]
|
||||||
locks = "cmd:perm(listplayers) or perm(Wizards)"
|
locks = "cmd:perm(listplayers) or perm(Admin)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -521,7 +521,7 @@ class CmdService(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@service"
|
key = "@service"
|
||||||
aliases = ["@services"]
|
aliases = ["@services"]
|
||||||
locks = "cmd:perm(service) or perm(Immortals)"
|
locks = "cmd:perm(service) or perm(Developer)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -645,7 +645,7 @@ class CmdTime(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@time"
|
key = "@time"
|
||||||
aliases = "@uptime"
|
aliases = "@uptime"
|
||||||
locks = "cmd:perm(time) or perm(Players)"
|
locks = "cmd:perm(time) or perm(Player)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -703,7 +703,7 @@ class CmdServerLoad(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@server"
|
key = "@server"
|
||||||
aliases = ["@serverload", "@serverprocess"]
|
aliases = ["@serverload", "@serverprocess"]
|
||||||
locks = "cmd:perm(list) or perm(Immortals)"
|
locks = "cmd:perm(list) or perm(Developer)"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -821,7 +821,7 @@ class CmdTickers(COMMAND_DEFAULT_CLASS):
|
||||||
"""
|
"""
|
||||||
key = "@tickers"
|
key = "@tickers"
|
||||||
help_category = "System"
|
help_category = "System"
|
||||||
locks = "cmd:perm(tickers) or perm(Builders)"
|
locks = "cmd:perm(tickers) or perm(Builder)"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
from evennia import TICKER_HANDLER
|
from evennia import TICKER_HANDLER
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,7 @@ class TestBuilding(CommandTest):
|
||||||
"Obj changed typeclass from evennia.objects.objects.DefaultObject to evennia.objects.objects.DefaultExit.")
|
"Obj changed typeclass from evennia.objects.objects.DefaultObject to evennia.objects.objects.DefaultExit.")
|
||||||
|
|
||||||
def test_lock(self):
|
def test_lock(self):
|
||||||
self.call(building.CmdLock(), "Obj = test:perm(Immortals)", "Added lock 'test:perm(Immortals)' to Obj.")
|
self.call(building.CmdLock(), "Obj = test:perm(Developer)", "Added lock 'test:perm(Developer)' to Obj.")
|
||||||
|
|
||||||
def test_find(self):
|
def test_find(self):
|
||||||
self.call(building.CmdFind(), "Room2", "One Match")
|
self.call(building.CmdFind(), "Room2", "One Match")
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ from evennia.objects.models import ObjectDB
|
||||||
from evennia.server.models import ServerConfig
|
from evennia.server.models import ServerConfig
|
||||||
from evennia.comms.models import ChannelDB
|
from evennia.comms.models import ChannelDB
|
||||||
|
|
||||||
from evennia.utils import create, logger, utils, ansi
|
from evennia.utils import create, logger, utils
|
||||||
from evennia.commands.cmdhandler import CMD_LOGINSTART
|
from evennia.commands.cmdhandler import CMD_LOGINSTART
|
||||||
|
|
||||||
COMMAND_DEFAULT_CLASS = utils.class_from_module(settings.COMMAND_DEFAULT_CLASS)
|
COMMAND_DEFAULT_CLASS = utils.class_from_module(settings.COMMAND_DEFAULT_CLASS)
|
||||||
|
|
@ -560,8 +560,8 @@ def _create_character(session, new_player, typeclass, home, permissions):
|
||||||
# set playable character list
|
# set playable character list
|
||||||
new_player.db._playable_characters.append(new_character)
|
new_player.db._playable_characters.append(new_character)
|
||||||
|
|
||||||
# allow only the character itself and the player to puppet this character (and Immortals).
|
# allow only the character itself and the player to puppet this character (and Developers).
|
||||||
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Immortals) or pperm(Immortals)" %
|
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Developer) or pperm(Developer)" %
|
||||||
(new_character.id, new_player.id))
|
(new_character.id, new_player.id))
|
||||||
|
|
||||||
# If no description is set, set a default description
|
# If no description is set, set a default description
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ class CmdOOCCharacterCreate(Command):
|
||||||
self.caller.msg("{rThe Character couldn't be created. This is a bug. Please contact an admin.")
|
self.caller.msg("{rThe Character couldn't be created. This is a bug. Please contact an admin.")
|
||||||
return
|
return
|
||||||
# make sure to lock the character to only be puppeted by this player
|
# make sure to lock the character to only be puppeted by this player
|
||||||
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Immortals) or pperm(Immortals)" %
|
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Developer) or pperm(Developer)" %
|
||||||
(new_character.id, self.caller.id))
|
(new_character.id, self.caller.id))
|
||||||
|
|
||||||
# save dbref
|
# save dbref
|
||||||
|
|
|
||||||
|
|
@ -235,8 +235,8 @@ its and @/./+/-/_ only.") # this echoes the restrictions made by django's auth m
|
||||||
# set playable character list
|
# set playable character list
|
||||||
new_player.db._playable_characters.append(new_character)
|
new_player.db._playable_characters.append(new_character)
|
||||||
|
|
||||||
# allow only the character itself and the player to puppet this character (and Immortals).
|
# allow only the character itself and the player to puppet this character (and Admin).
|
||||||
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Immortals) or pperm(Immortals)" %
|
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Developer) or pperm(Developer)" %
|
||||||
(new_character.id, new_player.id))
|
(new_character.id, new_player.id))
|
||||||
|
|
||||||
# If no description is set, set a default description
|
# If no description is set, set a default description
|
||||||
|
|
|
||||||
|
|
@ -1256,7 +1256,7 @@ class ContribRPObject(DefaultObject):
|
||||||
candidates.append(self)
|
candidates.append(self)
|
||||||
|
|
||||||
# the sdesc-related substitution
|
# the sdesc-related substitution
|
||||||
is_builder = self.locks.check_lockstring(self, "perm(Builders)")
|
is_builder = self.locks.check_lockstring(self, "perm(Builder)")
|
||||||
use_dbref = is_builder if use_dbref is None else use_dbref
|
use_dbref = is_builder if use_dbref is None else use_dbref
|
||||||
search_obj = lambda string: ObjectDB.objects.object_search(string,
|
search_obj = lambda string: ObjectDB.objects.object_search(string,
|
||||||
attribute_name=attribute_name,
|
attribute_name=attribute_name,
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class CmdTutorialSetDetail(default_cmds.MuxCommand):
|
||||||
multiple aliases to the detail all at once.
|
multiple aliases to the detail all at once.
|
||||||
"""
|
"""
|
||||||
key = "@detail"
|
key = "@detail"
|
||||||
locks = "cmd:perm(Builders)"
|
locks = "cmd:perm(Builder)"
|
||||||
help_category = "TutorialWorld"
|
help_category = "TutorialWorld"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
|
||||||
|
|
@ -603,7 +603,7 @@ class WildernessRoom(DefaultRoom):
|
||||||
searching, and is expected to produce something useful for
|
searching, and is expected to produce something useful for
|
||||||
builders.
|
builders.
|
||||||
"""
|
"""
|
||||||
if self.locks.check_lockstring(looker, "perm(Builders)"):
|
if self.locks.check_lockstring(looker, "perm(Builder)"):
|
||||||
name = "{}(#{})".format(self.location_name, self.id)
|
name = "{}(#{})".format(self.location_name, self.id)
|
||||||
else:
|
else:
|
||||||
name = self.location_name
|
name = self.location_name
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,8 @@ def perm(accessing_obj, accessed_obj, *args, **kwargs):
|
||||||
|
|
||||||
if utils.inherits_from(accessing_obj, "evennia.objects.objects.DefaultObject") and accessing_obj.player:
|
if utils.inherits_from(accessing_obj, "evennia.objects.objects.DefaultObject") and accessing_obj.player:
|
||||||
player = accessing_obj.player
|
player = accessing_obj.player
|
||||||
perms_player = [p.lower() for p in player.permissions.all()]
|
# we strip eventual plural forms, so Builders == Builder
|
||||||
|
perms_player = [p.lower().rstrip("s") for p in player.permissions.all()]
|
||||||
is_quell = player.attributes.get("_quell")
|
is_quell = player.attributes.get("_quell")
|
||||||
|
|
||||||
if permission in _PERMISSION_HIERARCHY:
|
if permission in _PERMISSION_HIERARCHY:
|
||||||
|
|
|
||||||
|
|
@ -56,21 +56,21 @@ Example:
|
||||||
|
|
||||||
We want to limit who may edit a particular object (let's call this access_type
|
We want to limit who may edit a particular object (let's call this access_type
|
||||||
for 'edit', it depends on what the command is looking for). We want this to
|
for 'edit', it depends on what the command is looking for). We want this to
|
||||||
only work for those with the Permission 'Builders'. So we use our lock
|
only work for those with the Permission 'Builder'. So we use our lock
|
||||||
function above and define it like this:
|
function above and define it like this:
|
||||||
|
|
||||||
'edit:perm(Builders)'
|
'edit:perm(Builder)'
|
||||||
|
|
||||||
Here, the lock-function perm() will be called with the string
|
Here, the lock-function perm() will be called with the string
|
||||||
'Builders' (accessing_obj and accessed_obj are added automatically,
|
'Builder' (accessing_obj and accessed_obj are added automatically,
|
||||||
you only need to add the args/kwargs, if any).
|
you only need to add the args/kwargs, if any).
|
||||||
|
|
||||||
If we wanted to make sure the accessing object was BOTH a Builders and a
|
If we wanted to make sure the accessing object was BOTH a Builder and a
|
||||||
GoodGuy, we could use AND:
|
GoodGuy, we could use AND:
|
||||||
|
|
||||||
'edit:perm(Builders) AND perm(GoodGuy)'
|
'edit:perm(Builder) AND perm(GoodGuy)'
|
||||||
|
|
||||||
To allow EITHER Builders and GoodGuys, we replace AND with OR. perm() is just
|
To allow EITHER Builder and GoodGuys, we replace AND with OR. perm() is just
|
||||||
one example, the lock function can do anything and compare any properties of
|
one example, the lock function can do anything and compare any properties of
|
||||||
the calling object to decide if the lock is passed or not.
|
the calling object to decide if the lock is passed or not.
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ the calling object to decide if the lock is passed or not.
|
||||||
To make these work, add the string to the lockhandler of the object you want
|
To make these work, add the string to the lockhandler of the object you want
|
||||||
to apply the lock to:
|
to apply the lock to:
|
||||||
|
|
||||||
obj.lockhandler.add('edit:perm(Builders)')
|
obj.lockhandler.add('edit:perm(Builder)')
|
||||||
|
|
||||||
From then on, a command that wants to check for 'edit' access on this
|
From then on, a command that wants to check for 'edit' access on this
|
||||||
object would do something like this:
|
object would do something like this:
|
||||||
|
|
@ -541,13 +541,13 @@ def _test():
|
||||||
obj1 = TestObj()
|
obj1 = TestObj()
|
||||||
obj2 = TestObj()
|
obj2 = TestObj()
|
||||||
|
|
||||||
#obj1.lock_storage = "owner:dbref(#4);edit:dbref(#5) or perm(Wizards);examine:perm(Builders);delete:perm(Wizards);get:all()"
|
#obj1.lock_storage = "owner:dbref(#4);edit:dbref(#5) or perm(Admin);examine:perm(Builder);delete:perm(Admin);get:all()"
|
||||||
#obj1.lock_storage = "cmd:all();admin:id(1);listen:all();send:all()"
|
#obj1.lock_storage = "cmd:all();admin:id(1);listen:all();send:all()"
|
||||||
obj1.lock_storage = "listen:perm(Immortals)"
|
obj1.lock_storage = "listen:perm(Developer)"
|
||||||
|
|
||||||
pdb.set_trace()
|
pdb.set_trace()
|
||||||
obj1.locks = LockHandler(obj1)
|
obj1.locks = LockHandler(obj1)
|
||||||
obj2.permissions.add("Immortals")
|
obj2.permissions.add("Developer")
|
||||||
obj2.id = 4
|
obj2.id = 4
|
||||||
|
|
||||||
#obj1.locks.add("edit:attr(test)")
|
#obj1.locks.add("edit:attr(test)")
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ from evennia.locks import lockfuncs
|
||||||
class TestLockCheck(EvenniaTest):
|
class TestLockCheck(EvenniaTest):
|
||||||
def testrun(self):
|
def testrun(self):
|
||||||
dbref = self.obj2.dbref
|
dbref = self.obj2.dbref
|
||||||
self.obj1.locks.add("owner:dbref(%s);edit:dbref(%s) or perm(Wizards);examine:perm(Builders) and id(%s);delete:perm(Wizards);get:all()" % (dbref, dbref, dbref))
|
self.obj1.locks.add("owner:dbref(%s);edit:dbref(%s) or perm(Admin);examine:perm(Builder) and id(%s);delete:perm(Admin);get:all()" % (dbref, dbref, dbref))
|
||||||
self.obj2.permissions.add('Wizards')
|
self.obj2.permissions.add('Admin')
|
||||||
self.assertEquals(True, self.obj1.locks.check(self.obj2, 'owner'))
|
self.assertEquals(True, self.obj1.locks.check(self.obj2, 'owner'))
|
||||||
self.assertEquals(True, self.obj1.locks.check(self.obj2, 'edit'))
|
self.assertEquals(True, self.obj1.locks.check(self.obj2, 'edit'))
|
||||||
self.assertEquals(True, self.obj1.locks.check(self.obj2, 'examine'))
|
self.assertEquals(True, self.obj1.locks.check(self.obj2, 'examine'))
|
||||||
|
|
@ -39,11 +39,11 @@ class TestLockCheck(EvenniaTest):
|
||||||
|
|
||||||
class TestLockfuncs(EvenniaTest):
|
class TestLockfuncs(EvenniaTest):
|
||||||
def testrun(self):
|
def testrun(self):
|
||||||
self.obj2.permissions.add('Wizards')
|
self.obj2.permissions.add('Admin')
|
||||||
self.assertEquals(True, lockfuncs.true(self.obj2, self.obj1))
|
self.assertEquals(True, lockfuncs.true(self.obj2, self.obj1))
|
||||||
self.assertEquals(False, lockfuncs.false(self.obj2, self.obj1))
|
self.assertEquals(False, lockfuncs.false(self.obj2, self.obj1))
|
||||||
self.assertEquals(True, lockfuncs.perm(self.obj2, self.obj1, 'Wizards'))
|
self.assertEquals(True, lockfuncs.perm(self.obj2, self.obj1, 'Admin'))
|
||||||
self.assertEquals(True, lockfuncs.perm_above(self.obj2, self.obj1, 'Builders'))
|
self.assertEquals(True, lockfuncs.perm_above(self.obj2, self.obj1, 'Builder'))
|
||||||
dbref = self.obj2.dbref
|
dbref = self.obj2.dbref
|
||||||
self.assertEquals(True, lockfuncs.dbref(self.obj2, self.obj1, '%s' % dbref))
|
self.assertEquals(True, lockfuncs.dbref(self.obj2, self.obj1, '%s' % dbref))
|
||||||
self.obj2.db.testattr = 45
|
self.obj2.db.testattr = 45
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
builders.
|
builders.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if self.locks.check_lockstring(looker, "perm(Builders)"):
|
if self.locks.check_lockstring(looker, "perm(Builder)"):
|
||||||
return "{}(#{})".format(self.name, self.id)
|
return "{}(#{})".format(self.name, self.id)
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
@ -973,15 +973,15 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
# controller, for example)
|
# controller, for example)
|
||||||
|
|
||||||
self.locks.add(";".join([
|
self.locks.add(";".join([
|
||||||
"control:perm(Immortals)", # edit locks/permissions, delete
|
"control:perm(Developer)", # edit locks/permissions, delete
|
||||||
"examine:perm(Builders)", # examine properties
|
"examine:perm(Builder)", # examine properties
|
||||||
"view:all()", # look at object (visibility)
|
"view:all()", # look at object (visibility)
|
||||||
"edit:perm(Wizards)", # edit properties/attributes
|
"edit:perm(Admin)", # edit properties/attributes
|
||||||
"delete:perm(Wizards)", # delete object
|
"delete:perm(Admin)", # delete object
|
||||||
"get:all()", # pick up object
|
"get:all()", # pick up object
|
||||||
"call:true()", # allow to call commands on this object
|
"call:true()", # allow to call commands on this object
|
||||||
"tell:perm(Wizards)", # allow emits to this object
|
"tell:perm(Admin)", # allow emits to this object
|
||||||
"puppet:pperm(Immortals)"])) # lock down puppeting only to staff by default
|
"puppet:pperm(Developer)"])) # lock down puppeting only to staff by default
|
||||||
|
|
||||||
def basetype_posthook_setup(self):
|
def basetype_posthook_setup(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class Bot(DefaultPlayer):
|
||||||
# the text encoding to use.
|
# the text encoding to use.
|
||||||
self.db.encoding = "utf-8"
|
self.db.encoding = "utf-8"
|
||||||
# A basic security setup
|
# A basic security setup
|
||||||
lockstring = "examine:perm(Wizards);edit:perm(Wizards);delete:perm(Wizards);boot:perm(Wizards);msg:false()"
|
lockstring = "examine:perm(Admin);edit:perm(Admin);delete:perm(Admin);boot:perm(Admin);msg:false()"
|
||||||
self.locks.add(lockstring)
|
self.locks.add(lockstring)
|
||||||
# set the basics of being a bot
|
# set the basics of being a bot
|
||||||
script_key = "%s" % self.key
|
script_key = "%s" % self.key
|
||||||
|
|
|
||||||
|
|
@ -566,8 +566,8 @@ class DefaultPlayer(with_metaclass(TypeclassBase, PlayerDB)):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# A basic security setup
|
# A basic security setup
|
||||||
lockstring = "examine:perm(Wizards);edit:perm(Wizards);" \
|
lockstring = "examine:perm(Admin);edit:perm(Admin);" \
|
||||||
"delete:perm(Wizards);boot:perm(Wizards);msg:all()"
|
"delete:perm(Admin);boot:perm(Admin);msg:all()"
|
||||||
self.locks.add(lockstring)
|
self.locks.add(lockstring)
|
||||||
|
|
||||||
# The ooc player cmdset
|
# The ooc player cmdset
|
||||||
|
|
|
||||||
|
|
@ -77,9 +77,9 @@ def create_objects():
|
||||||
god_player.swap_typeclass(player_typeclass, clean_attributes=True)
|
god_player.swap_typeclass(player_typeclass, clean_attributes=True)
|
||||||
god_player.basetype_setup()
|
god_player.basetype_setup()
|
||||||
god_player.at_player_creation()
|
god_player.at_player_creation()
|
||||||
god_player.locks.add("examine:perm(Immortals);edit:false();delete:false();boot:false();msg:all()")
|
god_player.locks.add("examine:perm(Developer);edit:false();delete:false();boot:false();msg:all()")
|
||||||
# this is necessary for quelling to work correctly.
|
# this is necessary for quelling to work correctly.
|
||||||
god_player.permissions.add("Immortals")
|
god_player.permissions.add("Developer")
|
||||||
|
|
||||||
# Limbo is the default "nowhere" starting room
|
# Limbo is the default "nowhere" starting room
|
||||||
|
|
||||||
|
|
@ -93,8 +93,8 @@ def create_objects():
|
||||||
god_character.id = 1
|
god_character.id = 1
|
||||||
god_character.save()
|
god_character.save()
|
||||||
god_character.db.desc = _('This is User #1.')
|
god_character.db.desc = _('This is User #1.')
|
||||||
god_character.locks.add("examine:perm(Immortals);edit:false();delete:false();boot:false();msg:all();puppet:false()")
|
god_character.locks.add("examine:perm(Developer);edit:false();delete:false();boot:false();msg:all();puppet:false()")
|
||||||
god_character.permissions.add("Immortals")
|
god_character.permissions.add("Developer")
|
||||||
|
|
||||||
god_player.attributes.add("_first_login", True)
|
god_player.attributes.add("_first_login", True)
|
||||||
god_player.attributes.add("_last_puppet", god_character)
|
god_player.attributes.add("_last_puppet", god_character)
|
||||||
|
|
|
||||||
|
|
@ -485,15 +485,15 @@ MULTISESSION_MODE = 0
|
||||||
MAX_NR_CHARACTERS = 1
|
MAX_NR_CHARACTERS = 1
|
||||||
# The access hierarchy, in climbing order. A higher permission in the
|
# The access hierarchy, in climbing order. A higher permission in the
|
||||||
# hierarchy includes access of all levels below it. Used by the perm()/pperm()
|
# hierarchy includes access of all levels below it. Used by the perm()/pperm()
|
||||||
# lock functions.
|
# lock functions, which accepts both plural and singular (Admin & Admins)
|
||||||
PERMISSION_HIERARCHY = ["Guests", # note-only used if GUEST_ENABLED=True
|
PERMISSION_HIERARCHY = ["Guest", # note-only used if GUEST_ENABLED=True
|
||||||
"Players",
|
"Player",
|
||||||
"PlayerHelpers",
|
"Helper",
|
||||||
"Builders",
|
"Builder",
|
||||||
"Wizards",
|
"Admin",
|
||||||
"Immortals"]
|
"Developer"]
|
||||||
# The default permission given to all new players
|
# The default permission given to all new players
|
||||||
PERMISSION_PLAYER_DEFAULT = "Players"
|
PERMISSION_PLAYER_DEFAULT = "Player"
|
||||||
# Default sizes for client window (in number of characters), if client
|
# Default sizes for client window (in number of characters), if client
|
||||||
# is not supplying this on its own
|
# is not supplying this on its own
|
||||||
CLIENT_DEFAULT_WIDTH = 78
|
CLIENT_DEFAULT_WIDTH = 78
|
||||||
|
|
@ -540,12 +540,12 @@ DEFAULT_CHANNELS = [
|
||||||
{"key": "Public",
|
{"key": "Public",
|
||||||
"aliases": ('ooc', 'pub'),
|
"aliases": ('ooc', 'pub'),
|
||||||
"desc": "Public discussion",
|
"desc": "Public discussion",
|
||||||
"locks": "control:perm(Wizards);listen:all();send:all()"},
|
"locks": "control:perm(Admin);listen:all();send:all()"},
|
||||||
# connection/mud info
|
# connection/mud info
|
||||||
{"key": "MudInfo",
|
{"key": "MudInfo",
|
||||||
"aliases": "",
|
"aliases": "",
|
||||||
"desc": "Connection log",
|
"desc": "Connection log",
|
||||||
"locks": "control:perm(Immortals);listen:perm(Wizards);send:false()"}
|
"locks": "control:perm(Developer);listen:perm(Admin);send:false()"}
|
||||||
]
|
]
|
||||||
# Extra optional channel for receiving connection messages ("<player> has (dis)connected").
|
# Extra optional channel for receiving connection messages ("<player> has (dis)connected").
|
||||||
# While the MudInfo channel will also receieve this, this channel is meant for non-staffers.
|
# While the MudInfo channel will also receieve this, this channel is meant for non-staffers.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue