Skip to Content
⚠ Under Construction
ReferencePython APIendstone.permissions

endstone.permissions

Classes:

NameDescription
PermissibleRepresents an object that may become a server operator and can be assigned permissions.
PermissionRepresents a unique permission that may be attached to a Permissible
PermissionAttachmentHolds information about a permission attachment on a Permissible object
PermissionAttachmentInfoHolds information on a permission and which PermissionAttachment provides it
PermissionDefaultRepresents the possible default values for permissions
PermissionLevel

Permissible

Represents an object that may become a server operator and can be assigned permissions.

Methods:

NameDescription
add_attachmentAdds a new PermissionAttachment.
has_permissionChecks if a permissions is available by name.
Checks if a permissions is available by permission.
is_permission_setChecks if a permissions is set by name.
Checks if a permissions is set by permission.
recalculate_permissionsRecalculates the permissions.
remove_attachmentRemoves a given PermissionAttachment.

Attributes:

NameTypeDescription
effective_permissionsset[PermissionAttachmentInfo]Gets effective permissions.
permission_levelPermissionLevelGets the permission level of this object

effective_permissions

effective_permissions: set[PermissionAttachmentInfo]

Gets effective permissions.

permission_level

permission_level: PermissionLevel

Gets the permission level of this object

add_attachment

add_attachment(plugin:Plugin, name:str, value:bool) -> PermissionAttachment

Adds a new PermissionAttachment.

add_attachment(plugin:Plugin) -> PermissionAttachment

Adds a new PermissionAttachment.

has_permission

has_permission(name:str) -> bool

Checks if a permissions is available by name.

has_permission(perm:Permission) -> bool

Checks if a permissions is available by permission.

is_permission_set

is_permission_set(name:str) -> bool

Checks if a permissions is set by name.

is_permission_set(perm:Permission) -> bool

Checks if a permissions is set by permission.

recalculate_permissions

recalculate_permissions() -> None

Recalculates the permissions.

remove_attachment

remove_attachment(attachment:PermissionAttachment) -> None

Removes a given PermissionAttachment.

Permission

Permission( name: str, description: str | None = None, default: PermissionDefault | None = None, children: dict[str, bool] | None = None, *args: dict[str, bool] | None, **kwargs: dict[str, bool] | None )

Represents a unique permission that may be attached to a Permissible

Methods:

NameDescription
add_parentAdds this permission to the specified parent permission.
recalculate_permissiblesRecalculates all Permissibles that contain this permission.

Attributes:

NameTypeDescription
childrendict[str, bool]Gets the children of this permission.
defaultPermissionDefaultThe default value of this permission.
descriptionstrThe brief description of this permission
namestrGets the unique fully qualified name of this Permission.
permissiblesset[Permissible]Gets a set containing every Permissible that has this permission.

children

children: dict[str, bool]

Gets the children of this permission.

default

default: PermissionDefault

The default value of this permission.

description

description: str

The brief description of this permission

name

name: str

Gets the unique fully qualified name of this Permission.

permissibles

permissibles: set[Permissible]

Gets a set containing every Permissible that has this permission.

add_parent

add_parent(name:str, value:bool) -> Permission

Adds this permission to the specified parent permission.

add_parent(perm:Permission, value:bool) -> None

Adds this permission to the specified parent permission.

recalculate_permissibles

recalculate_permissibles() -> None

Recalculates all Permissibles that contain this permission.

PermissionAttachment

PermissionAttachment(plugin:Plugin, permissible:Permissible)

Holds information about a permission attachment on a Permissible object

Methods:

NameDescription
removeRemoves this attachment from its registered Permissible.
set_permissionSets a permission to the given value, by its fully qualified name.
Sets a permission to the given value.
unset_permissionRemoves the specified permission from this attachment by name.
Removes the specified permission from this attachment.

Attributes:

NameTypeDescription
permissiblePermissibleGets the Permissible that this is attached to.
permissionsdict[str, bool]Gets a copy of all set permissions and values contained within this attachment.
pluginPluginGets the plugin responsible for this attachment.
removal_callbackCallable[[PermissionAttachment], None]The callback to be called when this attachment is removed.

permissible

permissible: Permissible

Gets the Permissible that this is attached to.

permissions

permissions: dict[str, bool]

Gets a copy of all set permissions and values contained within this attachment.

plugin

plugin: Plugin

Gets the plugin responsible for this attachment.

removal_callback

removal_callback: typing.Callable[[PermissionAttachment], None]

The callback to be called when this attachment is removed.

remove

remove() -> bool

Removes this attachment from its registered Permissible.

set_permission

set_permission(name:str, value:bool) -> None

Sets a permission to the given value, by its fully qualified name.

set_permission(perm:Permission, value:bool) -> None

Sets a permission to the given value.

unset_permission

unset_permission(name:str) -> None

Removes the specified permission from this attachment by name.

unset_permission(perm:Permission) -> None

Removes the specified permission from this attachment.

PermissionAttachmentInfo

PermissionAttachmentInfo( permissible: Permissible, permission: str, attachment: PermissionAttachment, value: bool, )

Holds information on a permission and which PermissionAttachment provides it

Attributes:

NameTypeDescription
attachmentPermissionAttachmentGets the attachment providing this permission.
permissiblePermissibleGet the permissible this is attached to
permissionstrGets the permission being set
valueboolGets the value of this permission

attachment

attachment: PermissionAttachment

Gets the attachment providing this permission.

permissible

permissible: Permissible

Get the permissible this is attached to

permission

permission: str

Gets the permission being set

value

value: bool

Gets the value of this permission

PermissionDefault

PermissionDefault(value:int)

Represents the possible default values for permissions

Attributes:

CONSOLE

CONSOLE: PermissionDefault

FALSE

FALSE: PermissionDefault

NOT_OP

NOT_OP: PermissionDefault

NOT_OPERATOR

NOT_OPERATOR: PermissionDefault

OP

OP: PermissionDefault

OPERATOR

OPERATOR: PermissionDefault

TRUE

TRUE: PermissionDefault

name

name: str

value

value: int

PermissionLevel

PermissionLevel(value:int)

Attributes:

CONSOLE

CONSOLE: PermissionLevel

DEFAULT

DEFAULT: PermissionLevel

OP

OP: PermissionLevel

OPERATOR

OPERATOR: PermissionLevel

name

name: str

value

value: int
Last updated on