Implemented a command to clear a level's permissions

This commit is contained in:
Timo Smit 2019-01-29 22:49:40 +01:00
parent 4d332c36a0
commit d5f051890a

View file

@ -166,6 +166,20 @@ function commandAclCopyLevelPermissions(levelId, newLevelId)
et.G_Print("copied permissions from "..levelId.." to "..newLevelId.."\n") et.G_Print("copied permissions from "..levelId.." to "..newLevelId.."\n")
end end
function commandAclRemoveLevelPermissions(levelId)
local levelId = tonumber(levelId)
if not levelId or not acl.isLevel(levelId) then
et.G_Print("usage: acl removepermissions [id]\n")
return true
end
acl.removeLevelPermissions(levelId)
et.G_Print("removed permissions from "..levelId.."\n")
end
function commandAcl(command, action, ...) function commandAcl(command, action, ...)
if action == "listlevels" then if action == "listlevels" then
return commandAclListLevels(...) return commandAclListLevels(...)
@ -185,8 +199,10 @@ function commandAcl(command, action, ...)
return commandAclRemoveLevelPermission(...) return commandAclRemoveLevelPermission(...)
elseif action == "copypermissions" then elseif action == "copypermissions" then
return commandAclCopyLevelPermissions(...) return commandAclCopyLevelPermissions(...)
elseif action == "removepermissions" then
return commandAclRemoveLevelPermissions(...)
else else
et.G_Print("usage: acl [listlevels|addlevel|removelevel|relevel|listpermissions|isallowed|addpermission|removepermission|copypermissions]") et.G_Print("usage: acl [listlevels|addlevel|removelevel|relevel|listpermissions|isallowed|addpermission|removepermission|copypermissions|removepermissions]")
end end
return true return true