mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
* 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 ✔️  * Turns the "Admin Permission Elevation Notification" into a macro --------- Co-authored-by: san7890 <the@san7890.com>
11 lines
517 B
Plaintext
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)
|
|
|