Skip to main content

AccessPlayer

This item only works when running on the server. Server

The server half of AccessPlayerBase. Adds the things only a server may do: forcing a fact, and saying whether a policy is actually running against this player.

Bound to every player automatically -- reach it with AccessPlayerInterface:Find(player) rather than by requiring this module, so consumers do not depend on the package.

Functions

PromiseClientAccessState

AccessPlayer.PromiseClientAccessState(selfAccessPlayer) → Promise<{[string]any}>

Asks this player's client what it thinks their access is.

For a console readout only. The answer is never used to decide anything -- a client that could report its own access authoritatively could grant itself whatever it liked. Its worth is that a person can see both realms at once, and a disagreement is exactly the bug this package exists to make visible.

Rejects if the client does not answer, which is itself informative: it means their realm never got far enough to have a view.

SetFactOverride

AccessPlayer.SetFactOverride(
selfAccessPlayer,
factNamestring,
valueboolean?
) → () → ()--

Clears this override

Forces a fact for this player, whatever its layers say. Pass nil to force unresolved.

ClearFactOverride

AccessPlayer.ClearFactOverride(
selfAccessPlayer,
factNamestring
) → ()

ClearFactOverrides

AccessPlayer.ClearFactOverrides(selfAccessPlayer) → ()

IsPolicyActive

AccessPlayer.IsPolicyActive(
selfAccessPlayer,
policyNamestring
) → boolean

Whether a policy is active for this player: enabled, in this realm, and tracking them.

No ForPlayer suffix here, unlike AccessPolicyService and [AccessPolicy]: this object is a player, so the suffix would name something already in the receiver. The rule is that a method says ForPlayer exactly when it takes one.

Show raw api
{
    "functions": [
        {
            "name": "PromiseClientAccessState",
            "desc": "Asks this player's client what *it* thinks their access is.\n\nFor a console readout only. The answer is never used to decide anything -- a client that could report\nits own access authoritatively could grant itself whatever it liked. Its worth is that a person can\nsee both realms at once, and a disagreement is exactly the bug this package exists to make visible.\n\nRejects if the client does not answer, which is itself informative: it means their realm never got\nfar enough to have a view.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AccessPlayer"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<{ [string]: any }>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 113,
                "path": "src/access/src/Server/Binders/AccessPlayer.lua"
            }
        },
        {
            "name": "SetFactOverride",
            "desc": "Forces a fact for this player, whatever its layers say. Pass nil to force unresolved.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AccessPlayer"
                },
                {
                    "name": "factName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "Clears this override",
                    "lua_type": "() -> ()"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 124,
                "path": "src/access/src/Server/Binders/AccessPlayer.lua"
            }
        },
        {
            "name": "ClearFactOverride",
            "desc": "",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AccessPlayer"
                },
                {
                    "name": "factName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 131,
                "path": "src/access/src/Server/Binders/AccessPlayer.lua"
            }
        },
        {
            "name": "ClearFactOverrides",
            "desc": "",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AccessPlayer"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 137,
                "path": "src/access/src/Server/Binders/AccessPlayer.lua"
            }
        },
        {
            "name": "IsPolicyActive",
            "desc": "Whether a policy is active for this player: enabled, in this realm, and tracking them.\n\nNo `ForPlayer` suffix here, unlike [AccessPolicyService] and [AccessPolicy]: this object *is* a player,\nso the suffix would name something already in the receiver. The rule is that a method says `ForPlayer`\nexactly when it takes one.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AccessPlayer"
                },
                {
                    "name": "policyName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 151,
                "path": "src/access/src/Server/Binders/AccessPlayer.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "AccessPlayer",
    "desc": "The server half of [AccessPlayerBase]. Adds the things only a server may do: forcing a fact, and\nsaying whether a policy is actually running against this player.\n\nBound to every player automatically -- reach it with `AccessPlayerInterface:Find(player)` rather than\nby requiring this module, so consumers do not depend on the package.",
    "realm": [
        "Server"
    ],
    "source": {
        "line": 12,
        "path": "src/access/src/Server/Binders/AccessPlayer.lua"
    }
}