pyplanet.contrib.permission

The permission contrib will provide permission abilities to players and admin levels.

class pyplanet.contrib.permission.PermissionManager(instance)[source]

Permission Manager manges the permissions of all apps and players.

Todo

Write introduction.

Warning

Don’t initiate this class yourself.

get_perm(namespace, name)[source]

Get permission by namespace and name.

Parameters
  • namespace (str) – Namespace of the permission

  • name (str) – Name of the permission.

has_permission(player, permission)[source]

Check if the player has the right permission.

Parameters
  • player – player instance.

  • permission – permission name.

Returns

boolean if player is allowed.

on_start()[source]

Handle startup, just before the apps will start. We will make sure we are ready to get requests for permissions.

register(name, description='', app=None, min_level=1, namespace=None)[source]

Register a new permission.

Parameters
  • name – Name of permission

  • description – Description in english.

  • app – App instance to retrieve the label.

  • min_level – Minimum level required.

  • namespace – Namespace, only for core usage!

Returns

Permission instance.