Skip to content

Commit

Permalink
restricts some VV-able vars to admin-only (ParadiseSS13#22539)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteelSlayer authored Sep 22, 2023
1 parent d0a459e commit d7bb95d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions code/datums/datumvars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,21 @@
/datum/proc/can_vv_get(var_name)
return TRUE

// /client/proc/can_vv_get(var_name)
// return TRUE
/mob/can_vv_get(var_name)
var/static/list/protected_vars = list(
"lastKnownIP", "computer_id"
)
if(!check_rights(R_ADMIN, FALSE, src) && (var_name in protected_vars))
return FALSE
return TRUE

/client/can_vv_get(var_name)
var/static/list/protected_vars = list(
"address", "computer_id"
)
if(!check_rights(R_ADMIN, FALSE, mob) && (var_name in protected_vars))
return FALSE
return TRUE

/datum/proc/vv_edit_var(var_name, var_value) //called whenever a var is edited
switch(var_name)
Expand Down

0 comments on commit d7bb95d

Please sign in to comment.