authentication

Set of classes to store authentication and permissions

class camelot.model.authentication.AuthenticationGroup(*args, **kwargs)[source]
A group of users (defined by their AuthenticationMechanism).
Different roles can be assigned to a group.
../../_images/new_view_authenticationgroup.png

Fields :

  • members : refers to <class ‘camelot.model.authentication.AuthenticationMechanism’>
class camelot.model.authentication.AuthenticationGroupRole(*args, **kwargs)[source]

Table with the different roles associated with an AuthenticationGroup

class camelot.model.authentication.AuthenticationMechanism(*args, **kwargs)[source]
../../_images/new_view_authenticationmechanism.png

Fields :

has_role(role_name)[source]
Parameters:role_name – a string with the name of the role
:return; True if the user is associated to this role, otherwise
False.
camelot.model.authentication.get_current_authentication(_obj=None)[source]

Get the currently logged in :class:’AuthenticationMechanism’

camelot.model.authentication.update_last_login(initial_group_name=None, initial_group_roles=[])[source]

Update the last login of the currently logged in user to now. If there is no AuthenticationGroup yet in the database, create one and add the user to it. This can be used to bootstrap the authentication system and create an admin group and add the user to it.

Parameters:
  • initial_group_name – The name of the authentication group that needs to be created if there is none yet.
  • initial_group_roles – a list with the roles for the initial group

Previous topic

model

Next topic

batch_job

This Page