Make the 'exec' prototype key only usable for Immortals from the command line. Also fixes a bug in the check_permission method that made it not honor quelling.
This commit is contained in:
parent
89568b5277
commit
faa3dca2d0
2 changed files with 10 additions and 3 deletions
|
|
@ -2597,6 +2597,7 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS):
|
||||||
self.caller.msg(string)
|
self.caller.msg(string)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
if isinstance(prototype, basestring):
|
if isinstance(prototype, basestring):
|
||||||
# A prototype key
|
# A prototype key
|
||||||
keystr = prototype
|
keystr = prototype
|
||||||
|
|
@ -2605,7 +2606,13 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS):
|
||||||
string = "No prototype named '%s'." % keystr
|
string = "No prototype named '%s'." % keystr
|
||||||
self.caller.msg(string + _show_prototypes(prototypes))
|
self.caller.msg(string + _show_prototypes(prototypes))
|
||||||
return
|
return
|
||||||
elif not isinstance(prototype, dict):
|
elif isinstance(prototype, dict):
|
||||||
|
# we got the prototype on the command line. We must make sure to not allow
|
||||||
|
# the 'exec' key unless we are immortals or higher.
|
||||||
|
if "exec" in prototype and not self.caller.check_permstring("Immortals"):
|
||||||
|
self.caller.msg("Spawn aborted: You don't have access to use the 'exec' prototype key.")
|
||||||
|
return
|
||||||
|
else:
|
||||||
self.caller.msg("The prototype must be a prototype key or a Python dictionary.")
|
self.caller.msg("The prototype must be a prototype key or a Python dictionary.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -525,10 +525,10 @@ class TypedObject(SharedMemoryModel):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if hasattr(self, "player"):
|
if hasattr(self, "player"):
|
||||||
if self.player and self.player.is_superuser:
|
if self.player and self.player.is_superuser and not self.player.attributes.get("_quell"):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
if self.is_superuser:
|
if self.is_superuser and not self.attributes.get("_quell"):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if not permstring:
|
if not permstring:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue