Files
Bubberstation/code/__HELPERS/admin.dm
san7890 655245393a Turns the "Admin Permission Elevation Notification" into a macro (#80149)
## About The Pull Request
Turns this boilerplate message into a centralized macro because this
code is important, but not so important that every coder know the nitty
gritty details of it. In case someone wants to add more logging/handling
(or update the message), there's now a central macro to update for all
nine events in which we check.

This shouldn't break anything because it's the exact same thing we were
doing previously and the early return checks are still all there, but it
does work on my machine regardless ✔️


![image](https://github.com/tgstation/tgstation/assets/34697715/db4405d3-e57d-4c29-8a01-b32ba185041b)
2023-12-06 18:00:35 -08:00

11 lines
517 B
Plaintext

/// Returns if the given client is an admin, REGARDLESS of if they're deadminned or not.
/proc/is_admin(client/client)
return !isnull(GLOB.admin_datums[client.ckey]) || !isnull(GLOB.deadmins[client.ckey])
/// Sends a message in the event that someone attempts to elevate their permissions through invoking a certain proc.
/proc/alert_to_permissions_elevation_attempt(mob/user)
var/message = " has tried to elevate permissions!"
message_admins(key_name_admin(user) + message)
log_admin(key_name(user) + message)