From 1c1b33bd8dd10631ff9ea204fda1fd449c95562e Mon Sep 17 00:00:00 2001 From: Intigracy Date: Thu, 9 May 2013 20:04:44 -0700 Subject: [PATCH] Pull Request #548 - vareditting ckey, key, icon, icon_state, overlays, underlays have permission alternatives Fixed indentation reauthored and rebased ~Carn Fixed the things carn pointed out. Thanks. ~Intigracy ckey editing and icon editing changes, added alternate requirements besides +DEBUG. ~Intigracy Modified code/modules/admin/verbs/modifyvariables.dm Signed-off-by: carnie --- code/modules/admin/verbs/modifyvariables.dm | 22 ++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index 2b5d1259083..da36e048340 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -130,7 +130,9 @@ var/list/forbidden_varedit_object_types = list( if(!istype(L,/list)) src << "Not a List." - var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state") + var/list/locked = list("vars", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine", "poo") + var/list/ckey_edit = list("key", "ckey") + var/list/icon_edit = list("icon", "icon_state", "overlays", "underlays") var/list/names = sortList(L) var/variable = input("Which var?","Var") as null|anything in names + "(ADD VAR)" @@ -148,6 +150,10 @@ var/list/forbidden_varedit_object_types = list( if(variable in locked) if(!check_rights(R_DEBUG)) return + if(variable in ckey_edit) + if(!check_rights(R_SPAWN|R_DEBUG)) return + if(variable in icon_edit) + if(!check_rights(R_FUN|R_DEBUG)) return if(isnull(variable)) usr << "Unable to determine variable type." @@ -268,7 +274,9 @@ var/list/forbidden_varedit_object_types = list( /client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0) if(!check_rights(R_VAREDIT)) return - var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "icon", "icon_state", "mutantrace") + var/list/locked = list("vars", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "mutantrace") + var/list/ckey_edit = list("key", "ckey") + var/list/icon_edit = list("icon", "icon_state", "overlays", "underlays") for(var/p in forbidden_varedit_object_types) if( istype(O,p) ) @@ -290,6 +298,10 @@ var/list/forbidden_varedit_object_types = list( if(param_var_name == "holder" || (param_var_name in locked)) if(!check_rights(R_DEBUG)) return + if(param_var_name in ckey_edit) + if(!check_rights(R_SPAWN|R_DEBUG)) return + if(param_var_name in icon_edit) + if(!check_rights(R_FUN|R_DEBUG)) return variable = param_var_name @@ -347,7 +359,11 @@ var/list/forbidden_varedit_object_types = list( var_value = O.vars[variable] if(variable == "holder" || (variable in locked)) - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) return + if(variable in ckey_edit) + if(!check_rights(R_SPAWN|R_DEBUG)) return + if(variable in icon_edit) + if(!check_rights(R_FUN|R_DEBUG)) return if(!autodetect_class)