aleph.model.role

Role

class aleph.model.role.Role

Imports

  • <UNKNOWN>
  • <UNKNOWN>
  • <UNKNOWN>

Summary

A user, group or other access control subject.

by_api_key(cls, api_key)
load_id(cls, foreign_id)

Load a role and return the ID.

If type is given and no role is found, a new role will be created.

by_prefix(cls, prefix)

Load a list of roles matching a name, email address, or foreign_id.

Parameters:pattern (str) – Pattern to match.
by_email(cls, email)
notifiable(cls)
load_or_create(cls, foreign_id, type, name)
by_foreign_id(cls, foreign_id)
all_groups(cls)
authenticate_using_ldap(cls, identifier, password)

Autheticates using user LDAP identifier and password.

Parameters:
  • identifier (str) – LDAP ID.
  • password (str) – LDAP password.
Returns:

A matched role.

Return type:

Role

__repr__(self)
__unicode__(self)
add_role(self, role)

Adds an existing role as a membership of a group.

check_password(self, secret)

Checks the password if it matches the role password hash.

Parameters:secret (str) – The password to be checked.
Return type:bool
clear_roles(self)

Removes any existing roles from group membership.

set_password(self, secret)

Hashes and sets the role password.

Parameters:secret (str) – The password to be set.
to_dict(self)
update(self, data)