Authentication and Authorization



class cubes.Authorizer
authorize(token, cubes)

Returns list of authorized cubes from cubes. If none of the cubes are authorized an empty list is returned.

Default implementation returs the same cubes list as provided.

hierarchy_limits(token, cube)

Returns a list of tuples: (dimension, hierarchy, level).

restricted_cell(token, cube, cell=None)

Restricts the cell for cube according to authorization by token. If no cell is provided or the cell is empty then returns the restriction cell. If there is no restriction, returns the original cell if provided or None.

class cubes.SimpleAuthorizer(rights_file=None, roles_file=None, roles=None, rights=None, identity_dimension=None, order=None, guest=None, **options)

Creates a simple JSON-file based authorizer. Reads data from rights_file and roles_file and merge them with roles and rights dictionaries respectively.


Merge right with its roles. right has to be a dictionary.

exception cubes.NotAuthorized

Raised when user is not authorized for the request.