magpie.ui.management.views

Module Contents

Classes

ManagementViews

Base methods for Magpie UI pages.

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

Bases: magpie.ui.utils.BaseViews

Base methods for Magpie UI pages.

Initialize self. See help(type(self)) for accurate signature.

get_all_groups(self, first_default_group=None)[source]
get_group_info(self, group_name)[source]
get_group_users(self, group_name)[source]
update_group_info(self, group_name, group_info)[source]
delete_group(self, group_name)[source]
get_user_groups(self, user_name)[source]
get_user_names(self)[source]
get_user_emails(self)[source]
get_resource_types(self)[source]
Returns

dictionary of all resources as {id: ‘resource_type’}

Return type

dict

get_services(self, cur_svc_type)[source]
get_service_data(self, service_name)[source]
get_service_types(self)[source]
update_service_name(self, old_service_name, new_service_name, service_push)[source]
update_service_url(self, service_name, new_service_url, service_push)[source]
goto_service(self, resource_id)[source]
static flatten_tree_resource(resource_node, resource_dict)[source]
Parameters
  • resource_node – any-level dictionary composing the resources tree

  • resource_dict – reference of flattened dictionary across levels

Returns

flattened dictionary resource_dict of all {id: ‘resource_type’}

Return type

dict

view_users(self)[source]
add_user(self)[source]
edit_user(self)[source]
view_groups(self)[source]
add_group(self)[source]
resource_tree_parser(self, raw_resources_tree, permission)[source]
perm_tree_parser(self, raw_perm_tree)[source]
static default_get(dictionary, key, default)[source]
edit_group_users(self, group_name)[source]
edit_user_or_group_resource_permissions(self, user_or_group_name, resource_id, is_user=False)[source]
get_user_or_group_resources_permissions_dict(self, user_or_group_name, services, service_type, is_user=False, is_inherit_groups_permissions=False)[source]
update_user_or_group_resources_permissions_dict(self, res_perms, res_id, removed_perms, new_perms)[source]
edit_group(self)[source]
static make_sync_error_message(service_names)[source]
sync_services(self: Dict[Str, JSON], services) → Tuple[List[Str], Optional[Str]][source]

Syncs specified services.

Returns

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

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