Skip to content

Auth ​

Types ​

Role type ​

luau
type Role = "everyone" | "vip" | "mod" | "admin" | "superadmin" | "creator" | string

Functions ​

banHandler Yields ​

luau
Auth.banHandler(player)

banUsers Yields ​

luau
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 ​

luau
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 ​

luau
Auth.networkMember(userId: number)

roleIdSort ​

luau
Auth.roleIdSort(a: Role, b: Role): boolean

Sorts roleIds by highest to lowest

roleIdSortAscending ​

luau
Auth.roleIdSortAscending(a: Role, b: Role): boolean

Sorts roleIds by lowest to highest

userRoleAdd ​

luau
Auth.userRoleAdd(userId: number, roleId: Role, persist: boolean?, unrestricted: boolean?): boolean

Adds a role to a user if they don't already have it

asyncRoleAdd ​

luau
Auth.asyncRoleAdd(userId: number, roleId: Role, fromGroup: boolean?): boolean

Gives a user a role they own through a group, gamepass, asset or subscription, which userRoleRemove keeps

hasAsyncRole ​

luau
Auth.hasAsyncRole(userId: number, roleId: Role): boolean

Checks if a user owns a role through a group, gamepass, asset or subscription

userRoleRemove ​

luau
Auth.userRoleRemove(userId: number, roleId: Role): boolean

Removes 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 ​

luau
Auth.userAsyncRoles(userId: number, bustCache: boolean?)

roleCanUseArgument ​

luau
Auth.roleCanUseArgument(roleId: Role, argument: any): boolean

Checks if a role has access to a command argument

roleCanUseCommand ​

luau
Auth.roleCanUseCommand(roleId: Role, command: any): boolean

Checks if a role has access to a command

hasArgument ​

luau
Auth.hasArgument(userId: number, argument: any): boolean

Checks if a user has access to a command argument

hasCommand ​

luau
Auth.hasCommand(userId: number, command: any): boolean | number

Checks if a user has access to a command, returns their rank if they do

hasPermission ​

luau
Auth.hasPermission(userId: number, permission: string): boolean

Checks if a user has access to a permission

hasRole ​

luau
Auth.hasRole(userId: number, roleId: Role): boolean

Checks if a user has a role or higher rank

getRank ​

luau
Auth.getRank(userId: number): (number, Role)

Checks the maximum role rank of the user

getRoleFromRank ​

luau
Auth.getRoleFromRank(rank: number): Role

Gets the closest role equal to or above a given rank

targetUserArgument Yields ​

luau
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 ​

luau
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 ​

luau
Auth.isPublicRole(roleId: Role): boolean

Checks if a role is handed out freely: free admin, friends of the creator, or every member of a group

hasRestrictedRole ​

luau
Auth.hasRestrictedRole(userId: number): boolean

Checks if a user has any developer roles; Roles not associated with any assets, gamepasses, subscriptions, and not handed out freely