hawat.blueprints.users package

This file contains pluggable module for Hawat web interface containing features related to user account management. These features include:

  • general user account listing

  • detailed user account view

  • creating new user accounts

  • updating existing user accounts

  • deleting existing user accounts

  • enabling existing user accounts

  • disabling existing user accounts

  • adding group memberships

  • removing group memberships

  • rejecting group membership requests

class hawat.blueprints.users.AddMembershipView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemObjectRelationView

View for adding group memberships.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

classmethod change_item(**kwargs)[source]

Interface implementation of vial.view.ItemChangeView.change_item().

property dbchlogmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel_other

Implementation of hawat.base.AddMemberView.dbmodel_other().

classmethod get_menu_legend(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

classmethod get_view_name()[source]

Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters [a-z0-9]. It will be used for generating endpoint name for the view.

This method does not have any default implementation and must be overridden by a subclass.

Returns

Name for the view.

Return type

str

classmethod get_view_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_view_title().

methods = ['GET', 'POST']
classmethod validate_item_change(**kwargs)[source]

Perform validation of particular change to given item.

hawat.blueprints.users.BLUEPRINT_NAME = 'users'

Name of the blueprint as module global constant.

class hawat.blueprints.users.CreateView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemCreateView

View for creating new user accounts.

authentication = True
authorization = [<Permission needs={Need(method='role', value='maintainer'), Need(method='role', value='admin')} excludes=set()>]
property dbchlogmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

static get_item_form(item)[source]

Implementation of vial.view.ItemCreateView.get_item_form().

static get_message_cancel(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

classmethod get_view_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_view_title().

methods = ['GET', 'POST']
class hawat.blueprints.users.DeleteView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemDeleteView

View for deleting existing user accounts.

authentication = True
authorization = [<Permission needs={Need(method='role', value='admin')} excludes=set()>]
property dbchlogmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

classmethod get_menu_legend(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

methods = ['GET', 'POST']
class hawat.blueprints.users.DisableView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemDisableView

View for disabling user accounts.

authentication = True
authorization = [<Permission needs={Need(method='role', value='maintainer'), Need(method='role', value='admin')} excludes=set()>]
property dbchlogmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

classmethod get_menu_legend(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

methods = ['GET', 'POST']
class hawat.blueprints.users.EnableView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemEnableView

View for enabling existing user accounts.

authentication = True
authorization = [<Permission needs={Need(method='role', value='maintainer'), Need(method='role', value='admin')} excludes=set()>]
property dbchlogmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

do_after_action(item)[source]

Implementation of vial.view.ItemActionView.do_after_action().

classmethod get_menu_legend(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

classmethod inform_user(account)[source]

Send infomail about user account activation.

methods = ['GET', 'POST']
class hawat.blueprints.users.ListView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemListView

General user account listing.

authentication = True
authorization = [<Permission needs={Need(method='role', value='maintainer'), Need(method='role', value='admin')} excludes=set()>]
property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

classmethod get_action_menu()[source]

Implementation of vial.view.ItemListView.get_action_menu().

classmethod get_context_action_menu()[source]

Implementation of vial.view.ItemListView.get_context_action_menu().

classmethod get_view_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

methods = ['GET']
class hawat.blueprints.users.MeView[source]

Bases: hawat.blueprints.users.ShowView

Detailed user account view for currently logged-in user (profile page).

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

dispatch_request()[source]

Mandatory interface required by the flask.views.View.dispatch_request(). Will be called by the Flask framework to service the request.

Single item with given unique identifier will be retrieved from database and injected into template to be displayed to the user.

classmethod get_breadcrumbs_menu()[source]

Get breadcrumbs menu.

classmethod get_menu_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

classmethod get_view_name()[source]

Implementation of vial.view.BaseView.get_view_name().

classmethod get_view_template()[source]

Implementation of vial.view.RenderableView.get_view_template().

classmethod get_view_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_view_title().

classmethod get_view_url(**kwargs)[source]

Implementation of vial.view.BaseView.get_view_url().

methods = ['GET']
class hawat.blueprints.users.RejectMembershipView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemObjectRelationView

View for rejecting group membership requests.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

classmethod change_item(**kwargs)[source]

Interface implementation of vial.view.ItemChangeView.change_item().

property dbchlogmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel_other

Implementation of hawat.base.AddMemberView.dbmodel_other().

classmethod get_menu_legend(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

classmethod get_view_name()[source]

Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters [a-z0-9]. It will be used for generating endpoint name for the view.

This method does not have any default implementation and must be overridden by a subclass.

Returns

Name for the view.

Return type

str

classmethod get_view_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_view_title().

methods = ['GET', 'POST']
classmethod validate_item_change(**kwargs)[source]

Perform validation of particular change to given item.

class hawat.blueprints.users.RemoveMembershipView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemObjectRelationView

View for removing group memberships.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

classmethod change_item(**kwargs)[source]

Interface implementation of vial.view.ItemChangeView.change_item().

property dbchlogmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel_other

Implementation of hawat.base.AddMemberView.dbmodel_other().

classmethod get_menu_legend(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

classmethod get_view_name()[source]

Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters [a-z0-9]. It will be used for generating endpoint name for the view.

This method does not have any default implementation and must be overridden by a subclass.

Returns

Name for the view.

Return type

str

classmethod get_view_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_view_title().

methods = ['GET', 'POST']
classmethod validate_item_change(**kwargs)[source]

Perform validation of particular change to given item.

class hawat.blueprints.users.ShowView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemShowView

Detailed user account view.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

do_before_response(**kwargs)[source]

Implementation of vial.view.RenderableView.do_before_response().

classmethod get_action_menu()[source]

Get action menu for particular item.

classmethod get_menu_legend(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

classmethod get_view_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_view_title().

methods = ['GET']
class hawat.blueprints.users.UpdateView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.ItemUpdateView

View for updating existing user accounts.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

property dbchlogmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

property dbmodel

Implementation of vial.view.mixin.SQLAlchemyMixin.dbmodel().

static get_item_form(item)[source]

Implementation of vial.view.ItemUpdateView.get_item_form().

classmethod get_menu_legend(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of vial.view.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of vial.view.BaseView.get_view_icon().

classmethod get_view_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_view_title().

methods = ['GET', 'POST']
class hawat.blueprints.users.UsersBlueprint(name, import_name, **kwargs)[source]

Bases: vial.app.VialBlueprint

Hawat pluggable module - user accounts.

classmethod get_module_title()[source]

Implementation of vial.app.VialBlueprint.get_module_title().

register_app(app)[source]

Callback method. Will be called from hawat.base.HawatApp.register_blueprint() method and can be used to customize the Flask application object. Possible use cases:

  • application menu customization

Parameters

app (hawat.base.HawatApp) – Flask application to be customized.

hawat.blueprints.users.get_blueprint()[source]

Mandatory interface for vial.Vial and factory function. This function must return a valid instance of vial.app.VialBlueprint or flask.Blueprint.