Add correct checks for builders to use build commands on entities they create.
This commit is contained in:
parent
6b3f92dcbf
commit
fd27442c39
1 changed files with 9 additions and 9 deletions
|
|
@ -144,7 +144,7 @@ class CmdSetObjAlias(COMMAND_DEFAULT_CLASS):
|
||||||
caller.msg("No aliases exist for '%s'." % obj.get_display_name(caller))
|
caller.msg("No aliases exist for '%s'." % obj.get_display_name(caller))
|
||||||
return
|
return
|
||||||
|
|
||||||
if not obj.access(caller, 'edit'):
|
if not obj.access(caller, "control") or obj.access(caller, 'edit'):
|
||||||
caller.msg("You don't have permission to do that.")
|
caller.msg("You don't have permission to do that.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -490,7 +490,7 @@ class CmdCreate(ObjManipCommand):
|
||||||
|
|
||||||
# create object (if not a valid typeclass, the default
|
# create object (if not a valid typeclass, the default
|
||||||
# object typeclass will automatically be used)
|
# object typeclass will automatically be used)
|
||||||
lockstring = "control:id(%s);delete:id(%s) or perm(Wizards)" % (caller.id, caller.id)
|
lockstring = "control:id(%s) or perm(Wizards);delete:id(%s) or perm(Wizards)" % (caller.id, caller.id)
|
||||||
obj = create.create_object(typeclass, name, caller,
|
obj = create.create_object(typeclass, name, caller,
|
||||||
home=caller, aliases=aliases,
|
home=caller, aliases=aliases,
|
||||||
locks=lockstring, report_to=caller)
|
locks=lockstring, report_to=caller)
|
||||||
|
|
@ -741,7 +741,7 @@ class CmdDig(ObjManipCommand):
|
||||||
typeclass = settings.BASE_ROOM_TYPECLASS
|
typeclass = settings.BASE_ROOM_TYPECLASS
|
||||||
|
|
||||||
# create room
|
# create room
|
||||||
lockstring = "control:id(%s) or perm(Immortals); delete:id(%s) or perm(Wizards); edit:id(%s) or perm(Wizards)"
|
lockstring = "control:id(%s) or perm(Wizards); delete:id(%s) or perm(Wizards); edit:id(%s) or perm(Wizards)"
|
||||||
lockstring = lockstring % (caller.dbref, caller.dbref, caller.dbref)
|
lockstring = lockstring % (caller.dbref, caller.dbref, caller.dbref)
|
||||||
|
|
||||||
new_room = create.create_object(typeclass, room["name"],
|
new_room = create.create_object(typeclass, room["name"],
|
||||||
|
|
@ -1145,7 +1145,7 @@ class CmdName(ObjManipCommand):
|
||||||
if not newname:
|
if not newname:
|
||||||
caller.msg("No name defined!")
|
caller.msg("No name defined!")
|
||||||
return
|
return
|
||||||
if not obj.access(caller, "edit"):
|
if not obj.access(caller, "control") or obj.access(caller, "edit"):
|
||||||
caller.mgs("You don't have right to edit this player %s." % obj)
|
caller.mgs("You don't have right to edit this player %s." % obj)
|
||||||
return
|
return
|
||||||
obj.username = newname
|
obj.username = newname
|
||||||
|
|
@ -1165,7 +1165,7 @@ class CmdName(ObjManipCommand):
|
||||||
if not newname and not aliases:
|
if not newname and not aliases:
|
||||||
caller.msg("No names or aliases defined!")
|
caller.msg("No names or aliases defined!")
|
||||||
return
|
return
|
||||||
if not obj.access(caller, "edit"):
|
if not obj.access(caller, "control") or obj.access(caller, "edit"):
|
||||||
caller.msg("You don't have the right to edit %s." % obj)
|
caller.msg("You don't have the right to edit %s." % obj)
|
||||||
return
|
return
|
||||||
# change the name and set aliases:
|
# change the name and set aliases:
|
||||||
|
|
@ -1631,7 +1631,7 @@ class CmdTypeclass(COMMAND_DEFAULT_CLASS):
|
||||||
self.switches.append("force")
|
self.switches.append("force")
|
||||||
self.switches.append("update")
|
self.switches.append("update")
|
||||||
|
|
||||||
if not obj.access(caller, 'edit'):
|
if not obj.access(caller, "control") or obj.access(caller, 'edit'):
|
||||||
caller.msg("You are not allowed to do that.")
|
caller.msg("You are not allowed to do that.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -1706,7 +1706,7 @@ class CmdWipe(ObjManipCommand):
|
||||||
obj = caller.search(objname)
|
obj = caller.search(objname)
|
||||||
if not obj:
|
if not obj:
|
||||||
return
|
return
|
||||||
if not obj.access(caller, 'edit'):
|
if not obj.access(caller, "control") or obj.access(caller, 'edit'):
|
||||||
caller.msg("You are not allowed to do that.")
|
caller.msg("You are not allowed to do that.")
|
||||||
return
|
return
|
||||||
if not attrs:
|
if not attrs:
|
||||||
|
|
@ -1754,7 +1754,7 @@ class CmdLock(ObjManipCommand):
|
||||||
"""
|
"""
|
||||||
key = "@lock"
|
key = "@lock"
|
||||||
aliases = ["@locks", "lock", "locks"]
|
aliases = ["@locks", "lock", "locks"]
|
||||||
locks = "cmd: perm(@locks) or perm(Builders)"
|
locks = "cmd: perm(locks) or perm(Builders)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
|
|
@ -1776,7 +1776,7 @@ class CmdLock(ObjManipCommand):
|
||||||
string = ""
|
string = ""
|
||||||
if lockdef:
|
if lockdef:
|
||||||
if 'del' in self.switches:
|
if 'del' in self.switches:
|
||||||
if not obj.access(caller, 'control'):
|
if not obj.access(caller, 'control') or obj.access(caller, "edit"):
|
||||||
caller.msg("You are not allowed to do that.")
|
caller.msg("You are not allowed to do that.")
|
||||||
return
|
return
|
||||||
obj.locks.delete(access_type)
|
obj.locks.delete(access_type)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue