geonature.core.gn_permissions.admin

Classes

Functions

filters_formatter(v, c, m, p)

modules_formatter(view, context, model, name)

groups_formatter(view, context, model, name)

role_formatter(view, context, model, name)

permissions_formatter(view, context, model, name)

permissions_count_formatter(view, context, model, name)

Module Contents

class geonature.core.gn_permissions.admin.RoleFilter[source]

Bases: geonature.core.admin.utils.DynamicOptionsMixin, flask_admin.contrib.sqla.filters.FilterEqual

get_dynamic_options(view)[source]
class geonature.core.gn_permissions.admin.ModuleFilter[source]

Bases: geonature.core.admin.utils.DynamicOptionsMixin, flask_admin.contrib.sqla.filters.FilterEqual

get_dynamic_options(view)[source]
class geonature.core.gn_permissions.admin.ObjectFilter[source]

Bases: geonature.core.admin.utils.DynamicOptionsMixin, flask_admin.contrib.sqla.filters.FilterEqual

get_dynamic_options(view)[source]
class geonature.core.gn_permissions.admin.ActionFilter[source]

Bases: geonature.core.admin.utils.DynamicOptionsMixin, flask_admin.contrib.sqla.filters.FilterEqual

get_dynamic_options(view)[source]
class geonature.core.gn_permissions.admin.ScopeFilter[source]

Bases: geonature.core.admin.utils.DynamicOptionsMixin, flask_admin.contrib.sqla.filters.FilterEqual

apply(query, value, alias=None)[source]
get_dynamic_options(view)[source]
geonature.core.gn_permissions.admin.filters_formatter(v, c, m, p)[source]
geonature.core.gn_permissions.admin.modules_formatter(view, context, model, name)[source]
geonature.core.gn_permissions.admin.groups_formatter(view, context, model, name)[source]
geonature.core.gn_permissions.admin.role_formatter(view, context, model, name)[source]
geonature.core.gn_permissions.admin.permissions_formatter(view, context, model, name)[source]
geonature.core.gn_permissions.admin.permissions_count_formatter(view, context, model, name)[source]
class geonature.core.gn_permissions.admin.OptionSelect2Widget[source]

Bases: flask_admin.form.widgets.Select2Widget

classmethod render_option(value, label, options)[source]
class geonature.core.gn_permissions.admin.OptionQuerySelectField(*args, **kwargs)[source]

Bases: flask_admin.contrib.sqla.fields.QuerySelectField

Overrides the QuerySelectField class from flask admin to allow other attributes on a select option.

options_additional_values is added in form_args, it is a list of strings, each element is the name of the attribute in the model which will be added on the option

widget[source]
options_additional_values[source]
iter_choices()[source]
class geonature.core.gn_permissions.admin.UserAjaxModelLoader[source]

Bases: flask_admin.contrib.sqla.ajax.QueryAjaxModelLoader

format(user)[source]
get_query()[source]
class geonature.core.gn_permissions.admin.ObjectAdmin[source]

Bases: geonature.core.admin.utils.CruvedProtectedMixin, flask_admin.contrib.sqla.ModelView

module_code = 'ADMIN'[source]
object_code = 'PERMISSIONS'[source]
can_create = False[source]
can_edit = False[source]
can_delete = False[source]
column_list = ('code_object', 'description_object', 'modules')[source]
column_labels[source]
column_default_sort = 'id_object'[source]
column_formatters[source]
class geonature.core.gn_permissions.admin.PermissionAdmin[source]

Bases: geonature.core.admin.utils.CruvedProtectedMixin, flask_admin.contrib.sqla.ModelView

module_code = 'ADMIN'[source]
object_code = 'PERMISSIONS'[source]
column_list = ('role', 'module', 'object', 'action', 'label', 'filters')[source]
column_labels[source]
column_searchable_list = ('role.identifiant', 'role.nom_complet')[source]
column_formatters[source]
column_filters[source]
named_filter_urls = True[source]
column_sortable_list = (('role', 'role.nom_complet'), ('module', 'module.module_code'), ('object',...[source]
column_default_sort = [('role.nom_complet', False), ('module.module_code', False), ('object.code_object', False),...[source]
form_columns = ('role', 'availability', 'scope', 'sensitivity_filter')[source]
form_overrides[source]
form_args[source]
create_template = 'admin/hide_select2_options_create.html'[source]
edit_template = 'admin/hide_select2_options_edit.html'[source]
form_ajax_refs[source]
render(template, **kwargs)[source]
create_form()[source]
class geonature.core.gn_permissions.admin.PermissionAvailableAdmin[source]

Bases: geonature.core.admin.utils.CruvedProtectedMixin, flask_admin.contrib.sqla.ModelView

module_code = 'ADMIN'[source]
object_code = 'PERMISSIONS'[source]
can_create = False[source]
can_delete = False[source]
can_export = False[source]
column_labels[source]
column_formatters[source]
column_sortable_list = (('module', 'module.module_code'), ('object', 'object.code_object'), ('action', 'action.code_action'))[source]
column_filters[source]
column_default_sort = [('module.module_code', False), ('object.code_object', False), ('id_action', False)][source]
form_columns = ('scope_filter', 'sensitivity_filter')[source]
class geonature.core.gn_permissions.admin.RolePermAdmin[source]

Bases: geonature.core.admin.utils.CruvedProtectedMixin, flask_admin.contrib.sqla.ModelView

module_code = 'ADMIN'[source]
object_code = 'PERMISSIONS'[source]
can_create = False[source]
can_edit = False[source]
can_delete = False[source]
can_export = False[source]
can_view_details = True[source]
details_template = 'role_or_group_detail.html'[source]
column_labels[source]
column_searchable_list = ('identifiant', 'nom_complet')[source]
column_formatters[source]
column_formatters_detail[source]
class geonature.core.gn_permissions.admin.GroupPermAdmin[source]

Bases: RolePermAdmin

column_list = ('nom_role', 'permissions_count')[source]
column_details_list = ('nom_role', 'permissions_count', 'permissions')[source]
get_query()[source]
get_count_query()[source]
class geonature.core.gn_permissions.admin.UserPermAdmin[source]

Bases: RolePermAdmin

column_list = ('identifiant', 'nom_role', 'prenom_role', 'groups', 'permissions_count')[source]
column_labels[source]
column_details_list = ('identifiant', 'nom_role', 'prenom_role', 'groups', 'permissions_count', 'permissions')[source]
get_query()[source]
get_count_query()[source]