Merge pull request #5200 from TheDZD/admin-check-fixes

Assorted Admin Rights Check Fixes
This commit is contained in:
Fox McCloud
2016-07-26 03:38:25 -04:00
committed by GitHub
4 changed files with 4 additions and 7 deletions
+1 -2
View File
@@ -873,8 +873,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
set name = "Reset Telecomms Scripts"
set desc = "Blanks all telecomms scripts from all telecomms servers"
if(!holder || !holder.rights || !holder.rights & R_ADMIN)
to_chat(usr, "<span class='warning'>Admin only.</span>")
if(!check_rights(R_ADMIN, 1, src))
return
var/confirm = alert(src, "You sure you want to blank all NTSL scripts?", "Confirm", "Yes", "No")
+1 -3
View File
@@ -126,7 +126,7 @@
var/author = CB.author
var/controls = "<A href='?src=\ref[src];id=[CB.id]'>\[Order\]</A>"
controls += {" <A href="?src=\ref[src];flag=[CB.id]">\[Flag[CB.flagged ? "ged" : ""]\]</A>"}
if(check_rights(R_ADMIN, user = user))
if(check_rights(R_ADMIN, 0, user = user))
controls += " <A style='color:red' href='?src=\ref[src];del=[CB.id]'>\[Delete\]</A>"
author += " (<A style='color:red' href='?src=\ref[src];delbyckey=[ckey(CB.ckey)]'>[ckey(CB.ckey)])</A>)"
dat += {"<tr>
@@ -255,7 +255,6 @@
screenstate = 4
if(href_list["del"])
if(!check_rights(R_ADMIN))
to_chat(usr, "You aren't an admin, piss off.")
return
var/datum/cachedbook/target = getBookByID(href_list["del"]) // Sanitized in getBookByID
var/ans = alert(usr, "Are you sure you wish to delete \"[target.title]\", by [target.author]? This cannot be undone.", "Library System", "Yes", "No")
@@ -272,7 +271,6 @@
if(href_list["delbyckey"])
if(!check_rights(R_ADMIN))
to_chat(usr, "You aren't an admin, piss off.")
return
var/tckey = ckey(href_list["delbyckey"])
var/ans = alert(usr,"Are you sure you wish to delete all books by [tckey]? This cannot be undone.", "Library System", "Yes", "No")
@@ -374,7 +374,7 @@
var/list/valid_body_accessories = new()
for(var/B in body_accessory_by_name)
var/datum/body_accessory/A = body_accessory_by_name[B]
if(check_rights(R_ADMIN, 1, src))
if(check_rights(R_ADMIN, 0, src))
valid_body_accessories = body_accessory_by_name.Copy()
else
if(!istype(A))
+1 -1
View File
@@ -245,7 +245,7 @@
if(jobban_isbanned(src,rank)) return 0
if(!is_job_whitelisted(src, rank)) return 0
if(!job.player_old_enough(src.client)) return 0
if(job.admin_only && !(check_rights(R_ADMIN, 0))) return 0
if(job.admin_only && !(check_rights(R_EVENT, 0))) return 0
if(config.assistantlimit)
if(job.title == "Civilian")