auth.manager module

Provides a singleton class to access player permissions.

class auth.manager.ParentPermissionDict[source]

Bases: auth.manager._PermissionDict

class auth.manager.ParentPermissions(name)[source]

Bases: auth.manager.PermissionBase

A container for parent permissions.

__init__(name)[source]

Initialize the object.

Parameters:name (str) – Name of the parent.
class auth.manager.PermissionBase(name)[source]

Bases: dict

Base class for parent and player permissions.

__init__(name)[source]

Initialize the object.

add(permission, server_id=None, update_backend=True)[source]

Add a permission.

Parameters:
  • permission (str) – The permission to add.
  • server_id (int) – The server ID to which the permission should be added. If no server ID is given, it will be only added to this server.
  • update_backend (bool) – If True, the backend will be updated.
add_parent(parent_name, update_backend=True)[source]

Add a parent.

Parameters:
  • parent_name (str) – Name of the parent.
  • update_backend (bool) – If True, the backend will be updated.
clear()[source]

Removes all permissions stored in this object and its parents.

flatten()[source]

Return all permissions flattened recursively.

Return type:generator
remove(permission, server_id=None, update_backend=True)[source]

Remove a permission.

Parameters:
  • permission (str) – The permission to remove.
  • server_id (int) – The server ID from which the permission should be removed. If no server ID is given, it will be only removed from this server.
  • update_backend (bool) – If True, the backend will be updated.
remove_parent(parent_name, update_backend=True)[source]

Remove a parent.

Parameters:
  • parent_name (str) – Name of the parent.
  • update_backend (bool) – If True, the backend will be updated.
class auth.manager.PlayerPermissionDict[source]

Bases: auth.manager._PermissionDict

class auth.manager.PlayerPermissions(name, steamid64)[source]

Bases: auth.manager.PermissionBase

A container for player permissions.

__init__(name, steamid64)[source]

Initialize the object.

Parameters:
  • name (str) – A SteamID2, SteamID3 or SteamID64 value.
  • steamid64 (int) – The SteamID64 value that was also used to store the object in the :class:PlayerPermissionDict`` object.
auth.manager.auth_manager = {'sql': <auth.backend.sql.SQLBackend object>, 'flatfile': <auth.backend.flatfile.FlatfileBackend object>}

The singleton object of _AuthManager.