Made builders and above see #dbrefs in various admin commands.

This commit is contained in:
Griatch 2016-03-22 15:17:50 +01:00
parent 7b80572bae
commit 24c733f7cb

View file

@ -240,7 +240,31 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
# main methods
## methods inherited from the database object (overload them here)
def get_display_name(self, looker, **kwargs):
"""
Displays the name of the object in a viewer-aware manner.
Args:
looker (TypedObject): The object or player that is looking
at/getting inforamtion for this object.
Returns:
name (str): A string containing the name of the object,
including the DBREF if this user is privileged to control
said object.
Notes:
This function could be extended to change how object names
appear to users in character, but be wary. This function
does not change an object's keys or aliases when
searching, and is expected to produce something useful for
builders.
"""
if self.locks.check_lockstring(looker, "pperm(Builders)"):
return "{}(#{})".format(self.name, self.id)
return self.name
def search(self, searchdata,
global_search=False,