PermissionsHandler
Shared permissions handler that works on both client and server. The actual data storage and networking is handled by the respective CmdrServer and CmdrClient implementations.
Functions
PlayerHasPermissionForCommand
PermissionsHandler:PlayerHasPermissionForCommand(commandName: string--
The name of the command to check
) → boolean--
Whether the player has permission
Checks if a player has permission to run a command
GetPlayerPermissionGroups
PermissionsHandler:GetPlayerPermissionGroups() → {string}--
Array of permission group names
Gets the permission groups for a player
SetPlayerPermissionGroups
PermissionsHandler:SetPlayerPermissionGroups(permissions: string | {string}--
The permission group(s) to set
) → ()Sets the direct permissions for a player. Does not override inherited permissions or group permissions.
GivePlayerPermissionGroups
PermissionsHandler:GivePlayerPermissionGroups(permissionGroups: string | {string}--
The permission groups to grant
) → ()Grants a player permission group(s). Adds the given permissions to the player's current permissions.
GetRobloxGroupRankPermissionGroups
PermissionsHandler:GetRobloxGroupRankPermissionGroups(robloxGroupId: number,--
The Roblox group id to get permissions for
rank: number--
The rank to get permissions for
) → {string}--
The permission groups granted to the rank
Gets the permissions granted to a particular rank in a group.
GiveRobloxGroupRankPermissionGroups
PermissionsHandler:GiveRobloxGroupRankPermissionGroups(robloxGroupId: number,--
The Roblox group id to grant permissions to
ranks: number | NumberRange,--
The ranks to apply the permissions to. Can be a single rank or a range of ranks.
permissionGroups: string | {string}--
The permissions to grant to the group
) → function--
A function that can be called to remove the permissions
Grants specified ranks in a Roblox Group permission to use the commands under a given PermissionGroup.
GiveRobloxGroupRolePermissionGroups
PermissionsHandler:GiveRobloxGroupRolePermissionGroups(robloxGroupId: number,--
The Roblox group id to grant permissions to
role: string,--
The role name to grant permissions to
permissionGroups: string | {string}--
The permission groups to grant
) → function--
A function that can be called to remove the permissions
Grants specified roles in a Roblox Group permission to use commands under a given PermissionGroup.
SetPermissionGroupInheritance
PermissionsHandler:SetPermissionGroupInheritance(permissionGroup: string,--
The permission group to set the inheritance for
inheritedGroups: string | {string}--
The group(s) to inherit permissions from
) → ()Sets the permission inheritance for a permission group.
GetPermissionInheritance
PermissionsHandler:GetPermissionInheritance(permissionGroup: string--
The permission group to get inheritance for
) → {string}--
Array of inherited permission groups
Fetches the inherited Permission Group(s) for a given Permission Group
GetCommandsAvailableToPermissionGroup
PermissionsHandler:GetCommandsAvailableToPermissionGroup(permissionGroup: string--
The permission group to get commands for
) → {string}--
Array of command names
Gets all commands available to a permission group