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.
.mudpy.limit.backups: 10
+.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
~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-_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.
- admin
.mudpy.limit.avatars: 7
# .mudpy.limit.backups: 10
+# .mudpy.limit.debug: true
.mudpy.limit.password_tries: 3
# .mudpy.log.file: var/mudpy.log
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."""
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)
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)
+
class User:
---
-_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.
- admin
.mudpy.limit.avatars: 7
.mudpy.limit.backups: 3
+# .mudpy.limit.debug: true
.mudpy.limit.password_tries: 3
.mudpy.log.file: var/mudpy.log