magpie.ui.management.views
¶
Module Contents¶
Classes¶
Base methods for Magpie UI pages. |
Attributes¶
-
class
magpie.ui.management.views.
ManagementViews
(request)[source]¶ Bases:
magpie.ui.utils.BaseViews
Base methods for Magpie UI pages.
-
get_user_statuses
(self: Union[str, int], status=0) → List[str][source]¶ Obtains all user names that have the corresponding status value.
-
get_user_details
(self: Optional[Union[str, int]], status=None) → List[magpie.typedefs.JSON][source]¶ Obtains all user details, optionally filtered to by corresponding status value.
Employ this method to avoid multiple requests fetching individual information.
-
get_resource_types
(self)[source]¶ - Returns
dictionary of all resources as {id: ‘resource_type’}
- Return type
dict
-
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
-
get_user_or_group_resources_permissions_dict
(self, 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.
- Result is a
-
sync_services
(self: Dict[magpie.typedefs.Str, magpie.typedefs.JSON], services) → Tuple[List[magpie.typedefs.Str], Optional[magpie.typedefs.Str]][source]¶ Syncs specified services.
- Returns
names of services that produced a sync error and corresponding sync message (if any).
-
static
get_last_sync_datetimes
(service_ids: List[int], session: sqlalchemy.orm.session.Session) → List[Optional[datetime.datetime]][source]¶
-