Don't allow those with 'edit' access to obj to change the 'control' lock.

This commit is contained in:
Griatch 2018-03-01 20:53:20 +01:00
parent 15b04666a5
commit cde9986be8

View file

@ -1853,9 +1853,16 @@ class CmdLock(ObjManipCommand):
obj = caller.search(objname)
if not obj:
return
if not (obj.access(caller, 'control') or obj.access(caller, "edit")):
has_control_access = obj.access(caller, 'control')
if access_type == 'control' and not has_control_access:
# only allow to change 'control' access if you have 'control' access already
caller.msg("You need 'control' access to change this type of lock.")
return
if not has_control_access or obj.access(caller, "edit"):
caller.msg("You are not allowed to do that.")
return
lockdef = obj.locks.get(access_type)
if lockdef: