Skip to main content

Auth

Functions

roleIdSort

Auth.roleIdSort(
aRole,
bRole
) → boolean

Sorts roleIds by highest to lowest

roleIdSortAscending

Auth.roleIdSortAscending(
aRole,
bRole
) → boolean

Sorts roleIds by lowest to highest

userRoleAdd

Auth.userRoleAdd(
userIdnumber,
roleIdRole,
persistboolean?
) → boolean

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

userRoleRemove

Auth.userRoleRemove(
userIdnumber,
roleIdRole
) → boolean

Removes a role from a user if it exists

roleCanUseArgument

Auth.roleCanUseArgument(
roleIdRole,
argumentany
) → boolean

Checks if a role has access to a command argument

roleCanUseCommand

Auth.roleCanUseCommand(
roleIdRole,
commandany
) → boolean

Checks if a role has access to a command

hasArgument

Auth.hasArgument(
userIdnumber,
argumentany
) → boolean

Checks if a user has access to a command argument

hasCommand

Auth.hasCommand(
userIdnumber,
commandany
) → boolean | number

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

hasPermission

Auth.hasPermission(
userIdnumber,
permissionstring
) → boolean

Checks if a user has access to a permission

getRank

Auth.getRank(userIdnumber) → (
number,
Role
)

Checks the maximum role rank of the user

getRoleFromRank

Auth.getRoleFromRank(ranknumber) → Role

Gets the closest role equal to or above a given rank

Show raw api
{
    "functions": [
        {
            "name": "roleIdSort",
            "desc": "Sorts roleIds by highest to lowest",
            "params": [
                {
                    "name": "a",
                    "desc": "",
                    "lua_type": "Role"
                },
                {
                    "name": "b",
                    "desc": "",
                    "lua_type": "Role"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 151,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "roleIdSortAscending",
            "desc": "Sorts roleIds by lowest to highest",
            "params": [
                {
                    "name": "a",
                    "desc": "",
                    "lua_type": "Role"
                },
                {
                    "name": "b",
                    "desc": "",
                    "lua_type": "Role"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 156,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "userRoleAdd",
            "desc": "Adds a role to a user if they don't already have it",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "roleId",
                    "desc": "",
                    "lua_type": "Role"
                },
                {
                    "name": "persist",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 161,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "userRoleRemove",
            "desc": "Removes a role from a user if it exists",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "roleId",
                    "desc": "",
                    "lua_type": "Role"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 204,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "roleCanUseArgument",
            "desc": "Checks if a role has access to a command argument",
            "params": [
                {
                    "name": "roleId",
                    "desc": "",
                    "lua_type": "Role"
                },
                {
                    "name": "argument",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 326,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "roleCanUseCommand",
            "desc": "Checks if a role has access to a command",
            "params": [
                {
                    "name": "roleId",
                    "desc": "",
                    "lua_type": "Role"
                },
                {
                    "name": "command",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 349,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "hasArgument",
            "desc": "Checks if a user has access to a command argument",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "argument",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 399,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "hasCommand",
            "desc": "Checks if a user has access to a command, returns their rank if they do",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "command",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean | number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 415,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "hasPermission",
            "desc": "Checks if a user has access to a permission",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "permission",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 434,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "getRank",
            "desc": "Checks the maximum role rank of the user",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "desc": "",
                    "lua_type": "Role"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 455,
                "path": "src/Auth.luau"
            }
        },
        {
            "name": "getRoleFromRank",
            "desc": "Gets the closest role equal to or above a given rank",
            "params": [
                {
                    "name": "rank",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Role\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 472,
                "path": "src/Auth.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Auth",
    "desc": "",
    "source": {
        "line": 10,
        "path": "src/Auth.luau"
    }
}