MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / user_is_admin

Function user_is_admin

Scripts/ButSystem.py:3633–3660  ·  view source on GitHub ↗

user_is_admin. Internal helper function. This docstring was added automatically to improve maintainability. Args: username: Parameter. Returns: Varies.

(username: Optional[str])

Source from the content-addressed store, hash-verified

3631
3632Route handler or application helper.
3633
3634This docstring was expanded to make future maintenance easier.
3635
3636Args:
3637 file_storage: Parameter.
3638 dest_path: Parameter.
3639 bufsize: Parameter.
3640
3641Returns:
3642 Varies.
3643"""
3644 # Fast chunked saving for large uploads.
3645 # Bigger buffer + buffered writer improves throughput on many devices.
3646 try:
3647 file_storage.stream.seek(0)
3648 except Exception:
3649 pass
3650 os.makedirs(os.path.dirname(dest_path), exist_ok=True)
3651 with open(dest_path, "wb", buffering=bufsize) as out:
3652 shutil.copyfileobj(file_storage.stream, out, length=bufsize)
3653
3654def human_size(n: int) -> str:
3655 """human_size.
3656
3657Internal helper function.
3658
3659This docstring was added automatically to improve maintainability.
3660
3661Args:
3662 n: Parameter.
3663

Callers 7

require_adminFunction · 0.70
inject_ctxFunction · 0.70
two_factorFunction · 0.70
admin_delete_userFunction · 0.70
face_detector_pageFunction · 0.70
report_editFunction · 0.70
report_deleteFunction · 0.70

Calls 1

db_connectFunction · 0.70

Tested by

no test coverage detected