MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / isPrivileged

Function isPrivileged

apps/host-selfhost/src/admin/require-admin.ts:82–86  ·  view source on GitHub ↗
(role: string)

Source from the content-addressed store, hash-verified

80 * there is only one place to be right about it.
81 */
82export const isPrivileged = (role: string): boolean =>
83 role
84 .split(",")
85 .map((part) => part.trim())
86 .some((part) => part === "owner" || part === "admin");
87
88/**
89 * Authorize the caller as an owner/admin OF THE INSTANCE'S ORGANIZATION.

Callers 3

resolveSelfHostOrgRoleFunction · 0.90
principalFromUserIdFunction · 0.90
requireInstanceAdminFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected