Use these helpers to resolve ranks and permissions. Use them for tag-based admin checks too.Documentation Index
Fetch the complete documentation index at: https://sphere.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
GetPermissions
Returns the permissions for a given rank, or all ranks and their permissions if no rank is provided.Example
Example
Annotation
Annotation
Input
Input
Rank String? • OptionalThe rank key to look up. If omitted, all ranks and their permissions are returned.
Output: Rank Provided
Output: Rank Provided
Returns {[string]: boolean}A map of permission keys to their granted state for the specified rank.Returns
nil if the rank does not exist in API.PermissionTable.Output: No Rank Provided
Output: No Rank Provided
Returns {[string]: {[string]: boolean}}A map of every rank key to its permissions map.
CheckPermission
Checks if a user has a permission key.Example
Example
Annotation
Annotation
Input
Input
Player Number | Player • RequiredThe player to check. Accepts either a
UserId or a Player instance.Permission String • RequiredThe permission key to check against. Names are matched exactly, see Permissions.Output
Output
Returns BooleanReturns
true if the player holds a rank that grants the requested permission. Returns false if the player has no rank, if API.PermissionTable is missing the rank entry, or if the permission is not granted.GetRank
Resolves the highest priority rank for a user. This readsSettings.Ranks.
Ranks and groups are cached per
UserId. Clear caches if ranks change at runtime.Example
Example
Annotation
Annotation
Input
Input
Player Number | Player • RequiredThe player to resolve. Accepts either a
UserId or a Player instance.Output
Output
Returns String?Returns the rank key string with the highest
Priority that the player qualifies for. Returns nil if the player does not qualify for any rank in Settings.Ranks.IsAdmin
Checks if the player has thesphere.admins tag.
Example
Example
Annotation
Annotation
Input
Input
Player Number | Player • RequiredThe player to check. Accepts either a
UserId or a Player instance.Output
Output
Returns BooleanReturns
true if the player has a rank. Returns false if the player does not have a rank or is not present in the current server.GetAvailableAdmins
Returns all admins currently in the server. Admins are players taggedsphere.admins.
Example
Example
Annotation
Annotation
Output: Admins Present
Output: Admins Present
Count NumberThe total number of admins currently in the server.Players {Player}A table of
Player instances for each admin found.Output: No Admins Present
Output: No Admins Present
Count NumberReturns
0.Players {Player}Returns an empty table.