Skip to main content

Auth

Functions

userRoleAdd

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

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

userRoleRemove

Auth.userRoleRemove(
userIdnumber,
roleRole
) → boolean

Removes a role from a user if it exists

getRank

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

Checks the maximum role rank of the user, if permission is given it will fetch the highest rank of the roles with that permission

roleCanUseCommand

Auth.roleCanUseCommand(
roleRole,
commandany
) → boolean

Checks if a role has access to a command group

hasCommand

Auth.hasCommand(
userIdnumber,
commandany
) → boolean

Checks if a user has access to a command

hasPermission

Auth.hasPermission(
userIdnumber,
permissionstring
) → boolean

Checks if a user has access to a permission

rankDiff

Auth.rankDiff(
userIdFromnumber,
userIdTonumber,
permissionstring?
) → ()

Gets the difference of two users' ranks, with an optional permission parameter

Show raw api
{
    "functions": [
        {
            "name": "userRoleAdd",
            "desc": "Adds a role to a user if they don't already have it",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "role",
                    "desc": "",
                    "lua_type": "Role"
                },
                {
                    "name": "persist",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 88,
                "path": "MainModule/Auth.luau"
            }
        },
        {
            "name": "userRoleRemove",
            "desc": "Removes a role from a user if it exists",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "role",
                    "desc": "",
                    "lua_type": "Role"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 134,
                "path": "MainModule/Auth.luau"
            }
        },
        {
            "name": "getRank",
            "desc": "Checks the maximum role rank of the user, if permission is given it will fetch the highest rank of the roles with that permission",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "permission",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "desc": "",
                    "lua_type": "Role"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 275,
                "path": "MainModule/Auth.luau"
            }
        },
        {
            "name": "roleCanUseCommand",
            "desc": "Checks if a role has access to a command group",
            "params": [
                {
                    "name": "role",
                    "desc": "",
                    "lua_type": "Role"
                },
                {
                    "name": "command",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 308,
                "path": "MainModule/Auth.luau"
            }
        },
        {
            "name": "hasCommand",
            "desc": "Checks if a user has access to a command",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "command",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 329,
                "path": "MainModule/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": 354,
                "path": "MainModule/Auth.luau"
            }
        },
        {
            "name": "rankDiff",
            "desc": "Gets the difference of two users' ranks, with an optional permission parameter",
            "params": [
                {
                    "name": "userIdFrom",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "userIdTo",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "permission",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 375,
                "path": "MainModule/Auth.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Auth",
    "desc": "",
    "source": {
        "line": 12,
        "path": "MainModule/Auth.luau"
    }
}