Skip to main content

PlayerIsAdminAccessFact

Whether the player has admin permission, from PermissionService. Pre-registered by AccessDataService, so every game has it without asking.

AccessFeature.anyOf("chapters", { AccessFactNames.PLAYER_IS_ADMIN, "ownsGame" })

Registered at AccessFactPriority.BUILT_IN -- the bottom -- so anything a game registers under the same name outranks it. A game with its own idea of who counts as staff layers over this rather than fighting it.

Why this is not one shared require

PermissionService lives in permissionprovider/src/Server and PermissionServiceClient in .../src/Client, and neither replicates to the other realm. So the realm is picked here, once, and both branches answer the same question under the same fact name. That is the shape every server-resolved fact has to take: same name in both realms, or the client sits unresolved forever and every feature declaring the fact never settles there.

Functions

new

PlayerIsAdminAccessFact.new(serviceBagServiceBag) → AccessFact

Constructs the fact, resolving the permission service for whichever realm this is.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs the fact, resolving the permission service for whichever realm this is.",
            "params": [
                {
                    "name": "serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AccessFact"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 46,
                "path": "src/access/src/Shared/Implementations/Facts/PlayerIsAdminAccessFact.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerIsAdminAccessFact",
    "desc": "Whether the player has admin permission, from [PermissionService]. Pre-registered by\n[AccessDataService], so every game has it without asking.\n\n```lua\nAccessFeature.anyOf(\"chapters\", { AccessFactNames.PLAYER_IS_ADMIN, \"ownsGame\" })\n```\n\nRegistered at [AccessFactPriority].BUILT_IN -- the bottom -- so anything a game registers under the\nsame name outranks it. A game with its own idea of who counts as staff layers over this rather than\nfighting it.\n\n## Why this is not one shared require\n\n`PermissionService` lives in `permissionprovider/src/Server` and `PermissionServiceClient` in\n`.../src/Client`, and neither replicates to the other realm. So the realm is picked here, once, and\nboth branches answer the same question under the same fact name. That is the shape every\nserver-resolved fact has to take: same name in both realms, or the client sits unresolved forever and\nevery feature declaring the fact never settles there.",
    "source": {
        "line": 24,
        "path": "src/access/src/Shared/Implementations/Facts/PlayerIsAdminAccessFact.lua"
    }
}