Source code for auth.base

# ../auth/base.py

"""Provides the base class for every backend."""

# =============================================================================
# >> ALL DECLARATION
# =============================================================================
__all__ = ('Backend',
    )


# =============================================================================
# >> CLASSES
# =============================================================================
[docs]class Backend(object): options = {}
[docs] def load(self): """Called when the backend is loaded.""" pass
[docs] def unload(self): """Called when the backend is unloaded.""" pass
[docs] def permission_added(self, node, permission, server_id): """Called when a permission has been added.""" pass
[docs] def permission_removed(self, node, permission, server_id): """Called when a permission has been removed.""" pass
[docs] def group_added(self, node, group_name): """Called when a group has been added.""" pass
[docs] def group_removed(self, node, group_name): """Called when a group has been removed.""" pass
[docs] def sync(self): """Synchronize the auth_manager with the backend.""" raise NotImplementedError('Backend must define a sync method.')
@property def name(self): """Return the name of the backend.""" raise NotImplementedError('Every backend must define a name.')