Skip to main content

PermissionService

Handles centralized permissions for different features.

NOTE

Update the GROUP_PERMISSIONS table to include appropriate permissions for the group hosting the project.

Functions

HasPermission

This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. Yields
PermissionService:HasPermission(
playerPlayer,--

The player to check

permissionstring--

The permission label to check against

) → boolean--

Whether the player has the permission

Checks whether the player has the given permission. Returns true if they do, or false if their rank is too low.

Show raw api
{
    "functions": [
        {
            "name": "HasPermission",
            "desc": "Checks whether the player has the given permission. Returns `true` if they\ndo, or `false` if their rank is too low.",
            "params": [
                {
                    "name": "player",
                    "desc": "The player to check",
                    "lua_type": "Player"
                },
                {
                    "name": "permission",
                    "desc": "The permission label to check against",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "Whether the player has the permission",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "yields": true,
            "source": {
                "line": 72,
                "path": "src/shared/core/tasks/PermissionService.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PermissionService",
    "desc": "Handles centralized permissions for different features.\n\n:::note\nUpdate the `GROUP_PERMISSIONS` table to include appropriate permissions\nfor the group hosting the project.\n:::",
    "source": {
        "line": 19,
        "path": "src/shared/core/tasks/PermissionService.luau"
    }
}