magpie.ui.management.views ========================== .. py:module:: magpie.ui.management.views Attributes ---------- .. autoapisummary:: magpie.ui.management.views.LOGGER Classes ------- .. autoapisummary:: magpie.ui.management.views.ManagementViews Module Contents --------------- .. py:data:: LOGGER .. py:class:: ManagementViews(request) Bases: :py:obj:`magpie.ui.utils.AdminRequests`, :py:obj:`magpie.ui.utils.BaseViews` Regroups multiple administration-level operations to be dispatched to the API requests. .. py:method:: goto_service(resource_id) .. py:method:: view_users() .. py:method:: add_user() 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. .. seealso:: :meth:`magpie.ui.login.views.LoginViews.register_user` .. py:method:: edit_user() Edit the fields of any referenced user profile by an administrator. .. seealso:: - :meth:`magpie.ui.user.views.UserViews.edit_current_user` for corresponding operation by user self-update .. py:method:: view_pending_user() 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. .. py:method:: view_groups() .. py:method:: add_group() .. py:method:: resource_tree_parser(raw_resources_tree, permission) .. py:method:: perm_tree_parser(raw_perm_tree) .. py:method:: edit_group_users(group_name) .. py:method:: edit_user_or_group_resource_permissions(user_or_group_name, is_user=False) .. py:method:: get_user_or_group_resources_permissions_dict(user_or_group_name, services, service_type, is_user=False, is_inherit_groups_permissions=False) Get the user or group applied permissions as well as applicable permissions for corresponding services. Result is a :class:`tuple` of: - combined :term:`Allowed Permissions ` (*names only*) for services and their children :term:`Resources `. - dictionary of key-service-name, each with recursive map value of children resource details including the :term:`Applied Permissions ` or :term:`Inherited Resources` for the corresponding :term:`User` or :term:`Group` accordingly to specified arguments. .. py:method:: edit_group() .. py:method:: make_sync_error_message(service_names) :staticmethod: .. py:method:: sync_services(services: Dict[magpie.typedefs.Str, magpie.typedefs.JSON]) -> Tuple[List[magpie.typedefs.Str], Optional[magpie.typedefs.Str]] Syncs specified services. :returns: names of services that produced a sync error and corresponding sync message (if any). .. py:method:: get_remote_resources_info(res_perms, services, session) .. py:method:: merge_remote_resources(res_perms, services, session) :staticmethod: .. py:method:: get_last_sync_datetimes(service_ids: List[int], session: sqlalchemy.orm.session.Session) -> List[Optional[datetime.datetime]] :staticmethod: .. py:method:: delete_resource(res_id) .. py:method:: get_ids_to_clean(resources) .. py:method:: add_remote_resource(service_type, services_names, user_or_group, remote_id, is_user=False) .. py:method:: get_service_resources(service_name) .. py:method:: view_services() .. py:method:: add_service() .. py:method:: edit_service() .. py:method:: add_resource()