Adds a permission to only view runtimes (#13072)

* Adds a permission to only view runtimes

* It would appear I am half asleep

* Almost failed my own CI tests there. good job AA
This commit is contained in:
AffectedArc07
2020-03-25 16:15:18 -06:00
committed by GitHub
parent 23490a52bf
commit 8fdc0a6245
6 changed files with 14 additions and 6 deletions
+1
View File
@@ -44,6 +44,7 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
if("mod") rights |= R_MOD
if("mentor") rights |= R_MENTOR
if("proccall") rights |= R_PROCCALL
if("viewruntimes") rights |= R_VIEWRUNTIMES
GLOB.admin_ranks[rank] = rights
previous_rights = rights
+5 -1
View File
@@ -230,7 +230,9 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
/client/proc/add_admin_verbs()
if(holder)
verbs += GLOB.admin_verbs_default
// If they have ANYTHING OTHER THAN ONLY VIEW RUNTIMES (65536), then give them the default admin verbs
if(holder.rights != R_VIEWRUNTIMES)
verbs += GLOB.admin_verbs_default
if(holder.rights & R_BUILDMODE)
verbs += /client/proc/togglebuildmodeself
if(holder.rights & R_ADMIN)
@@ -264,6 +266,8 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
verbs += GLOB.admin_verbs_mentor
if(holder.rights & R_PROCCALL)
verbs += GLOB.admin_verbs_proccall
if(holder.rights & R_VIEWRUNTIMES)
verbs += /client/proc/view_runtimes
/client/proc/remove_admin_verbs()
verbs.Remove(
+1 -1
View File
@@ -832,7 +832,7 @@ GLOBAL_PROTECT(AdminProcCaller)
set name = "View Runtimes"
set desc = "Open the Runtime Viewer"
if(!check_rights(R_DEBUG))
if(!check_rights(R_DEBUG|R_VIEWRUNTIMES))
return
GLOB.error_cache.showTo(usr)