Skip to content

Commit

Permalink
bugfix/admin: vv options rights fix (#6378)
Browse files Browse the repository at this point in the history
  • Loading branch information
dageavtobusnick authored Jan 18, 2025
1 parent 3b1d9d6 commit d813647
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions code/datums/datumvars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,6 @@
#undef VV_HTML_ENCODE

/client/proc/view_var_Topic(href, href_list, hsrc)
//This should all be moved over to datum/admins/Topic() or something ~Carn
if(!check_rights(R_VAREDIT, FALSE) && !((href_list["datumrefresh"] || href_list["Vars"] || href_list["VarsList"])))
return

if(view_var_Topic_list(href, href_list, hsrc)) // done because you can't use UIDs with lists and I don't want to snowflake into the below check to supress warnings
return
Expand Down Expand Up @@ -1385,7 +1382,7 @@
href_list["datumrefresh"] = href_list["mobToDamage"]

else if(href_list["traitmod"])
if(!check_rights(NONE))
if(!check_rights(R_DEBUG|R_ADMIN))
return
var/datum/A = locateUID(href_list["traitmod"])
if(!istype(A))
Expand All @@ -1411,6 +1408,8 @@
return TRUE

if(href_list["listedit"] && href_list["index"])
if(!check_rights(R_VAREDIT))
return
var/index = text2num(href_list["index"])
if(!index)
return TRUE
Expand All @@ -1424,6 +1423,8 @@
return TRUE

if(href_list["listchange"] && href_list["index"])
if(!check_rights(R_VAREDIT))
return
var/index = text2num(href_list["index"])
if(!index)
return TRUE
Expand All @@ -1437,6 +1438,8 @@
return TRUE

if(href_list["listremove"] && href_list["index"])
if(!check_rights(R_VAREDIT))
return
var/index = text2num(href_list["index"])
if(!index)
return TRUE
Expand All @@ -1457,6 +1460,8 @@
return TRUE

if(href_list["listadd"])
if(!check_rights(R_VAREDIT))
return
var/list/L = locate(href_list["listadd"])
if(!istype(L))
to_chat(usr, "This can only be used on instances of type /list", confidential=TRUE)
Expand All @@ -1466,6 +1471,8 @@
return TRUE

if(href_list["listdupes"])
if(!check_rights(R_VAREDIT))
return
var/list/L = locate(href_list["listdupes"])
if(!istype(L))
to_chat(usr, "This can only be used on instances of type /list", confidential=TRUE)
Expand All @@ -1478,6 +1485,8 @@
return TRUE

if(href_list["listnulls"])
if(!check_rights(R_VAREDIT))
return
var/list/L = locate(href_list["listnulls"])
if(!istype(L))
to_chat(usr, "This can only be used on instances of type /list", confidential=TRUE)
Expand All @@ -1490,6 +1499,8 @@
return TRUE

if(href_list["listlen"])
if(!check_rights(R_VAREDIT))
return
var/list/L = locate(href_list["listlen"])
if(!istype(L))
to_chat(usr, "This can only be used on instances of type /list", confidential=TRUE)
Expand All @@ -1505,6 +1516,9 @@
return TRUE

if(href_list["listshuffle"])
if(!check_rights(R_VAREDIT))
return

var/list/L = locate(href_list["listshuffle"])
if(!istype(L))
to_chat(usr, "This can only be used on instances of type /list", confidential=TRUE)
Expand Down

0 comments on commit d813647

Please sign in to comment.