Skip to main content

PermissionService

This item only works when running on the server. Server

Provides permissions for the game. See BasePermissionProvider.

tip

Be sure to initialize the PermissionServiceClient on the client.

local require = require(script.Parent.loader).load(script)

local PermissionProvider = require("PermissionProvider")
local PermissionProviderUtils = require("PermissionProviderUtils")

return PermissionProvider.new(PermissionProviderUtils.createGroupRankConfig({
  groupId = 8668163;
  minAdminRequiredRank = 250;
  minCreatorRequiredRank = 254;
}))

Functions

Init

PermissionService:Init(_serviceBagServiceBag) → ()

Initializes the service. Should be done via ServiceBag.

SetProviderFromConfig

PermissionService:SetProviderFromConfig(config{typestring}) → ()

Start

PermissionService:Start() → ()

Starts the permission service. Should be done via ServiceBag.

PromisePermissionProvider

PermissionService:PromisePermissionProvider() → Promise<BasePermissionProvider>

Returns the permission provider

PromiseIsAdmin

PermissionService:PromiseIsAdmin(playerPlayer) → Promise<boolean>

Returns whether the player is an admin.

PromiseIsCreator

PermissionService:PromiseIsCreator(playerPlayer) → Promise<boolean>

Returns whether the player is a creator.

PromiseIsPermissionLevel

PermissionService:PromiseIsPermissionLevel(
playerPlayer,
permissionLevelPermissionLevel
) → Promise<boolean>

Returns whether the player is a creator.

ObservePermissionedPlayersBrio

PermissionService:ObservePermissionedPlayersBrio(permissionLevelPermissionLevel) → Observable<Brio<Player>>

Observe all creators in the game

Show raw api
{
    "functions": [
        {
            "name": "Init",
            "desc": "Initializes the service. Should be done via [ServiceBag].",
            "params": [
                {
                    "name": "_serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 46,
                "path": "src/permissionprovider/src/Server/PermissionService.lua"
            }
        },
        {
            "name": "SetProviderFromConfig",
            "desc": "Sets the provider from a config. See [PermissionProviderUtils.createGroupRankConfig]\nand [PermissionProviderUtils.createSingleUserConfig].",
            "params": [
                {
                    "name": "config",
                    "desc": "",
                    "lua_type": "{ type: string }"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 64,
                "path": "src/permissionprovider/src/Server/PermissionService.lua"
            }
        },
        {
            "name": "Start",
            "desc": "Starts the permission service. Should be done via [ServiceBag].",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 80,
                "path": "src/permissionprovider/src/Server/PermissionService.lua"
            }
        },
        {
            "name": "PromisePermissionProvider",
            "desc": "Returns the permission provider",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<BasePermissionProvider>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 94,
                "path": "src/permissionprovider/src/Server/PermissionService.lua"
            }
        },
        {
            "name": "PromiseIsAdmin",
            "desc": "Returns whether the player is an admin.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 105,
                "path": "src/permissionprovider/src/Server/PermissionService.lua"
            }
        },
        {
            "name": "PromiseIsCreator",
            "desc": "Returns whether the player is a creator.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 116,
                "path": "src/permissionprovider/src/Server/PermissionService.lua"
            }
        },
        {
            "name": "PromiseIsPermissionLevel",
            "desc": "Returns whether the player is a creator.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "permissionLevel",
                    "desc": "",
                    "lua_type": "PermissionLevel"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 128,
                "path": "src/permissionprovider/src/Server/PermissionService.lua"
            }
        },
        {
            "name": "ObservePermissionedPlayersBrio",
            "desc": "Observe all creators in the game",
            "params": [
                {
                    "name": "permissionLevel",
                    "desc": "",
                    "lua_type": "PermissionLevel"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<Player>>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 144,
                "path": "src/permissionprovider/src/Server/PermissionService.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PermissionService",
    "desc": "Provides permissions for the game. See [BasePermissionProvider].\n\n:::tip\nBe sure to initialize the [PermissionServiceClient] on the client.\n:::\n\n```lua\nlocal require = require(script.Parent.loader).load(script)\n\nlocal PermissionProvider = require(\"PermissionProvider\")\nlocal PermissionProviderUtils = require(\"PermissionProviderUtils\")\n\nreturn PermissionProvider.new(PermissionProviderUtils.createGroupRankConfig({\n  groupId = 8668163;\n  minAdminRequiredRank = 250;\n  minCreatorRequiredRank = 254;\n}))\n```",
    "realm": [
        "Server"
    ],
    "source": {
        "line": 24,
        "path": "src/permissionprovider/src/Server/PermissionService.lua"
    }
}