summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b27c62e)
Create a new configuration flag, .mudpy.limit.debug, which indicates
unsafe debugging options will be available in the running engine.
This is unused, but lays the groundwork for future unsafe commands
to be toggled at start in base configuration.
configuration
===============
configuration
===============
-.. Copyright (c) 2004-2019 mudpy authors. Permission to use, copy,
+.. Copyright (c) 2004-2020 mudpy authors. Permission to use, copy,
modify, and distribute this software is granted under terms
provided in the LICENSE file distributed with this software.
modify, and distribute this software is granted under terms
provided in the LICENSE file distributed with this software.
+.mudpy.limit.debug
+~~~~~~~~~~~~~~~~~~
+
+bool, optional
+
+Whether unsafe debugging functionality is enabled. If unspecified or
+set to false, unsafe debugging functions will be disabled.
+
+Example::
+
+ .mudpy.limit.debug: true
+
.mudpy.limit.password_tries
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.mudpy.limit.password_tries
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-_copy: Copyright (c) 2004-2019 mudpy authors. Permission to use, copy,
+_copy: Copyright (c) 2004-2020 mudpy authors. Permission to use, copy,
modify, and distribute this software is granted under terms
provided in the LICENSE file distributed with this software.
modify, and distribute this software is granted under terms
provided in the LICENSE file distributed with this software.
- admin
.mudpy.limit.avatars: 7
# .mudpy.limit.backups: 10
- admin
.mudpy.limit.avatars: 7
# .mudpy.limit.backups: 10
+# .mudpy.limit.debug: true
.mudpy.limit.password_tries: 3
# .mudpy.log.file: var/mudpy.log
.mudpy.limit.password_tries: 3
# .mudpy.log.file: var/mudpy.log
def is_restricted(self):
"""Boolean check whether command is administrative or debugging."""
def is_restricted(self):
"""Boolean check whether command is administrative or debugging."""
- return(self.get("administrative", False))
+ return(
+ self.get("administrative", False) or self.get("debugging", False))
def is_admin(self):
"""Boolean check whether an actor is controlled by an admin owner."""
def is_admin(self):
"""Boolean check whether an actor is controlled by an admin owner."""
if command not in self.universe.groups["command"].values():
return(False)
if command not in self.universe.groups["command"].values():
return(False)
+ # debugging commands are not allowed outside debug mode
+ if command.get("debugging") and not self.universe.debug_mode():
+ return(False)
+
# avatars of administrators can run any command
if self.is_admin():
return(True)
# avatars of administrators can run any command
if self.is_admin():
return(True)
if fallback not in self.files:
mudpy.data.Data(fallback, self, flags=flags)
if fallback not in self.files:
mudpy.data.Data(fallback, self, flags=flags)
+ def debug_mode(self):
+ """Boolean method to indicate whether unsafe debugging is enabled."""
+ return self.groups["mudpy"]["limit"].get("debug", False)
+
-_copy: Copyright (c) 2004-2019 mudpy authors. Permission to use, copy,
+_copy: Copyright (c) 2004-2020 mudpy authors. Permission to use, copy,
modify, and distribute this software is granted under terms
provided in the LICENSE file distributed with this software.
modify, and distribute this software is granted under terms
provided in the LICENSE file distributed with this software.
- admin
.mudpy.limit.avatars: 7
.mudpy.limit.backups: 3
- admin
.mudpy.limit.avatars: 7
.mudpy.limit.backups: 3
+# .mudpy.limit.debug: true
.mudpy.limit.password_tries: 3
.mudpy.log.file: var/mudpy.log
.mudpy.limit.password_tries: 3
.mudpy.log.file: var/mudpy.log