Home › Overview › MainModule
Auth
Types
Role type
type Role = "everyone" | "vip" | "mod" | "admin" | "superadmin" | "creator" | stringFunctions
banHandler Yields
Auth.banHandler(player)banUsers Yields
Auth.banUsers(userIds: { number }, reason: string?, duration: number?, fromUserId: number?, forceBanAsync: boolean?): { number }Bans users and returns the ones banned; saved bans are kept unless the caller can use banasync
unbanUsers Yields
Auth.unbanUsers(userIds: { number }, fromUserId: number?, forceBanAsync: boolean?): { number }Unbans users and returns the ones unbanned; saved bans are kept unless the caller can use banasync
networkMember
Auth.networkMember(userId: number)roleIdSort
Sorts roleIds by highest to lowest
roleIdSortAscending
Sorts roleIds by lowest to highest
userRoleAdd
Auth.userRoleAdd(userId: number, roleId: Role, persist: boolean?, unrestricted: boolean?): booleanAdds a role to a user if they don't already have it
asyncRoleAdd
Auth.asyncRoleAdd(userId: number, roleId: Role, fromGroup: boolean?): booleanGives a user a role they own through a group, gamepass, asset or subscription, which userRoleRemove keeps
hasAsyncRole
Auth.hasAsyncRole(userId: number, roleId: Role): booleanChecks if a user owns a role through a group, gamepass, asset or subscription
userRoleRemove
Auth.userRoleRemove(userId: number, roleId: Role): booleanRemoves a role from a user if it exists. A role the user owns through a group, gamepass, asset or subscription (Auth.hasAsyncRole) stays, only a saved copy of it is removed.
userAsyncRoles Yields
Auth.userAsyncRoles(userId: number, bustCache: boolean?)roleCanUseArgument
Auth.roleCanUseArgument(roleId: Role, argument: any): booleanChecks if a role has access to a command argument
roleCanUseCommand
Auth.roleCanUseCommand(roleId: Role, command: any): booleanChecks if a role has access to a command
hasArgument
Auth.hasArgument(userId: number, argument: any): booleanChecks if a user has access to a command argument
hasCommand
Auth.hasCommand(userId: number, command: any): boolean | numberChecks if a user has access to a command, returns their rank if they do
hasPermission
Auth.hasPermission(userId: number, permission: string): booleanChecks if a user has access to a permission
hasRole
Auth.hasRole(userId: number, roleId: Role): booleanChecks if a user has a role or higher rank
getRank
Auth.getRank(userId: number): (number, Role)Checks the maximum role rank of the user
getRoleFromRank
Auth.getRoleFromRank(rank: number): RoleGets the closest role equal to or above a given rank
targetUserArgument Yields
Auth.targetUserArgument(arg: any, userId: number, value: Player | number | string)Validates if a user can be targeted by a command argument based on permissions and rank limits
prefetchGroupEntryRanks
Auth.prefetchGroupEntryRanks()Starts fetching the entry rank of every group in the group roles, so role checks don't stay closed on first use
isPublicRole
Auth.isPublicRole(roleId: Role): booleanChecks if a role is handed out freely: free admin, friends of the creator, or every member of a group
hasRestrictedRole
Auth.hasRestrictedRole(userId: number): booleanChecks if a user has any developer roles; Roles not associated with any assets, gamepasses, subscriptions, and not handed out freely