-- Compiled with @isentinel/roblox-ts v4.0.11 local TS = _G[script] local includes = TS.import(script, TS.getModule(script, "@lisachandra", "core").utils.string).includes local groupId = 0 local allowedUserIds = {} local allowedRoles = { "Developer", "Founder" } --[[ * * Configures the Roblox group ID used for centurion command authorization. * * @param id - The Roblox group ID to check roles against. ]] local function configureCenturionGroup(id) groupId = id end --[[ * * Configures which group roles are authorized to run admin commands. Default: `["Developer", * "Founder"]`. ]] local function configureCenturionRoles(roles) table.clear(allowedRoles) for _, role in roles do table.insert(allowedRoles, role) end end --[[ * * Configures which Roblox user IDs are authorized to run admin commands. * * @param userIds - The Roblox user IDs that should bypass group-role checks. ]] local function configureCenturionUsers(userIds) table.clear(allowedUserIds) for _, userId in userIds do table.insert(allowedUserIds, userId) end end --[[ * * Centurion guard that checks whether the command executor is explicitly allowed by user ID or * belongs to the configured group with an authorized role. * * @param context - The command context, providing the executor and error reporting. * @returns `true` if the executor has an allowed user ID or role; otherwise `false` and an error is * reported to the context. ]] local function adminOrDeveloper(context) for _, allowedUserId in allowedUserIds do if context.executor.UserId == allowedUserId then return true end end local role = context.executor:GetRoleInGroup(groupId) for _, allowed in allowedRoles do if includes(role, allowed) then return true end end context:error(`Insufficient permissions for {context.executor.Name} ({context:getData()})`) return false end return { configureCenturionGroup = configureCenturionGroup, configureCenturionRoles = configureCenturionRoles, configureCenturionUsers = configureCenturionUsers, adminOrDeveloper = adminOrDeveloper, }