diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 6653ce92fa..571c134b30 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -1875,9 +1875,16 @@ class CmdLock(ObjManipCommand): caller.msg("Added lock '%s' to %s." % (lockdef, obj)) return - # if we get here, we are just viewing all locks - obj = caller.search(self.lhs) + # if we get here, we are just viewing all locks on obj + obj = None + if self.lhs.startswith("*"): + obj = caller.search_account(self.lhs.lstrip("*")) if not obj: + obj = caller.search(self.lhs) + if not obj: + return + if not (obj.access(caller, 'control') or obj.access(caller, "edit")): + caller.msg("You are not allowed to do that.") return caller.msg("\n".join(obj.locks.all())) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index 1e7e4fad69..94f1372056 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -19,6 +19,7 @@ from evennia.scripts.scripthandler import ScriptHandler from evennia.commands import cmdset, command from evennia.commands.cmdsethandler import CmdSetHandler from evennia.commands import cmdhandler +from evennia.utils import search from evennia.utils import logger from evennia.utils.utils import (variable_from_module, lazy_property, make_iter, to_unicode, is_iter) @@ -435,7 +436,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): if searchdata.lower() in ("me", "self",): return [self.account] if quiet else self.account - results = self.account.__class__.objects.account_search(searchdata) + results = search.search_account(searchdata) if quiet: return results