mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-05-17 20:30:46 +01:00
47564346fb
* Begin * Begin 2 * move to tsx * fix that UI * fix gib * bunch of fixes * fix this one * Nicer ahelp bot text formatting * clean up all inputs * . * fix MC tab * fix ore spawn * with rare * More filter stuff * Cleaned up world * Fix * ummm * . * fix that * . * Begin * Begin 2 * move to tsx * fix that UI * fix gib * bunch of fixes * fix this one * clean up all inputs * Nicer ahelp bot text formatting * . * fix MC tab * fix ore spawn * with rare * More filter stuff * Cleaned up world * Fix * Added missing props * useContext fix * . --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
32 lines
803 B
Plaintext
32 lines
803 B
Plaintext
/*!
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/**
|
|
* tgui state: admin_state
|
|
*
|
|
* Checks if the user has specific admin permissions.
|
|
*/
|
|
|
|
GLOBAL_DATUM_INIT(admin_states, /alist, alist())
|
|
GLOBAL_PROTECT(admin_states)
|
|
|
|
/datum/tgui_state/admin_state
|
|
/// The specific admin permissions required for the UI using this state.
|
|
VAR_FINAL/required_perms = R_ADMIN
|
|
|
|
/datum/tgui_state/admin_state/New(required_perms = R_ADMIN)
|
|
. = ..()
|
|
src.required_perms = required_perms
|
|
|
|
/datum/tgui_state/admin_state/can_use_topic(src_object, mob/user)
|
|
if(check_rights_for(user.client, required_perms))
|
|
return STATUS_INTERACTIVE
|
|
return STATUS_CLOSE
|
|
|
|
/datum/tgui_state/admin_state/vv_edit_var(var_name, var_value)
|
|
if(var_name == NAMEOF(src, required_perms))
|
|
return FALSE
|
|
return ..()
|