magpie.ui.management.views

Attributes

LOGGER

Classes

ManagementViews

Regroups multiple administration-level operations to be dispatched to the API requests.

Module Contents

magpie.ui.management.views.LOGGER[source]
class magpie.ui.management.views.ManagementViews(request)[source]

Bases: magpie.ui.utils.AdminRequests, magpie.ui.utils.BaseViews

Regroups multiple administration-level operations to be dispatched to the API requests.

goto_service(resource_id)[source]
view_users()[source]
add_user()[source]

User creation by a logged administrator.

Note

The template employed for this form is reused for user self-registration as the fields and validation of inputs are essentially the same. Their actual processing is different though, as the administrator user is already logged in this case, and nobody is logged in the other.

edit_user()[source]

Edit the fields of any referenced user profile by an administrator.

See also

view_pending_user()[source]

Displays a pending user registration profile details.

Note

View configuration is added dynamically because this page it should be available only when the corresponding feature is activated with configuration settings.

view_groups()[source]
add_group()[source]
resource_tree_parser(raw_resources_tree, permission)[source]
perm_tree_parser(raw_perm_tree)[source]
edit_group_users(group_name)[source]
edit_user_or_group_resource_permissions(user_or_group_name, is_user=False)[source]
get_user_or_group_resources_permissions_dict(user_or_group_name, services, service_type, is_user=False, is_inherit_groups_permissions=False)[source]

Get the user or group applied permissions as well as applicable permissions for corresponding services.

Result is a tuple of:
  • combined Allowed Permissions (names only) for services and their children Resources.

  • dictionary of key-service-name, each with recursive map value of children resource details including the Applied Permissions or Inherited Resources for the corresponding User or Group accordingly to specified arguments.

edit_group()[source]
static make_sync_error_message(service_names)[source]
sync_services(services: Dict[magpie.typedefs.Str, magpie.typedefs.JSON]) Tuple[List[magpie.typedefs.Str], magpie.typedefs.Str | None][source]

Syncs specified services.

Returns:

names of services that produced a sync error and corresponding sync message (if any).

get_remote_resources_info(res_perms, services, session)[source]
static merge_remote_resources(res_perms, services, session)[source]
static get_last_sync_datetimes(service_ids: List[int], session: sqlalchemy.orm.session.Session) List[datetime.datetime | None][source]
delete_resource(res_id)[source]
get_ids_to_clean(resources)[source]
add_remote_resource(service_type, services_names, user_or_group, remote_id, is_user=False)[source]
get_service_resources(service_name)[source]
view_services()[source]
add_service()[source]
edit_service()[source]
add_resource()[source]