mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-21 20:01:18 +00:00
Fixed acl not being able to copy level permissions to levels with existing permissions
This commit is contained in:
parent
e9a4704df1
commit
4d332c36a0
3 changed files with 2 additions and 8 deletions
|
@ -161,12 +161,6 @@ function commandAclCopyLevelPermissions(levelId, newLevelId)
|
|||
return true
|
||||
end
|
||||
|
||||
if #acl.getLevelPermissions(newLevelId) ~= 0 then
|
||||
et.G_Print("error: level "..newLevelId.." already has permissions\n")
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
acl.copyLevelPermissions(levelId, newLevelId)
|
||||
|
||||
et.G_Print("copied permissions from "..levelId.." to "..newLevelId.."\n")
|
||||
|
|
|
@ -178,7 +178,7 @@ function mysql.removeLevelPermission(levelId, permission)
|
|||
end
|
||||
|
||||
function mysql.copyLevelPermissions(levelId, newLevelId)
|
||||
cur = assert(con:execute("INSERT INTO `level_permission` (`level_id`, `permission`) SELECT '"..tonumber(newLevelId).."' AS `level_id`, `permission` FROM `level_permission` WHERE `level_id`="..tonumber(levelId)))
|
||||
cur = assert(con:execute("INSERT INTO `level_permission` (`level_id`, `permission`) SELECT "..tonumber(newLevelId).." AS `level_id`, `permission` FROM `level_permission` WHERE `level_id`="..tonumber(levelId).." EXCEPT SELECT `level_id`, `permission` FROM `level_permission` WHERE `level_id`="..tonumber(newLevelId)))
|
||||
end
|
||||
|
||||
function mysql.removeLevelPermissions(levelId)
|
||||
|
|
|
@ -178,7 +178,7 @@ function sqlite3.removeLevelPermission(levelId, permission)
|
|||
end
|
||||
|
||||
function sqlite3.copyLevelPermissions(levelId, newLevelId)
|
||||
cur = assert(con:execute("INSERT INTO `level_permission` (`level_id`, `permission`) SELECT '"..tonumber(newLevelId).."' AS `level_id`, `permission` FROM `level_permission` WHERE `level_id`="..tonumber(levelId)))
|
||||
cur = assert(con:execute("INSERT INTO `level_permission` (`level_id`, `permission`) SELECT "..tonumber(newLevelId).." AS `level_id`, `permission` FROM `level_permission` WHERE `level_id`="..tonumber(levelId).." EXCEPT SELECT `level_id`, `permission` FROM `level_permission` WHERE `level_id`="..tonumber(newLevelId)))
|
||||
end
|
||||
|
||||
function sqlite3.removeLevelPermissions(levelId)
|
||||
|
|
Loading…
Reference in a new issue