magpie.api.management.user ========================== .. py:module:: magpie.api.management.user Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/magpie/api/management/user/user_formats/index /autoapi/magpie/api/management/user/user_utils/index /autoapi/magpie/api/management/user/user_views/index Attributes ---------- .. autoapisummary:: magpie.api.management.user.LOGGER Classes ------- .. autoapisummary:: magpie.api.management.user.UserFactory Functions --------- .. autoapisummary:: magpie.api.management.user.get_logger magpie.api.management.user.includeme Package Contents ---------------- .. py:class:: UserFactory(request: pyramid.request.Request) Bases: :py:obj:`RootFactory` Used to build base Access Control List (ACL) of the request user. All API and UI routes will employ this set of effective principals to determine if the user is authorized to access the pyramid view according to the ``permission`` value it was configured with. .. note:: Keep in mind that `Magpie` is configured with default permission :py:data:`magpie.constants.MAGPIE_ADMIN_PERMISSION`. Views that require more permissive authorization must be overridden with ``permission`` argument. .. seealso:: - ``set_default_permission`` within :func:`magpie.includeme` initialization steps .. py:attribute:: path_user :value: None .. py:method:: __getitem__(user_name: magpie.typedefs.Str) -> UserFactory .. py:property:: __acl__ :type: magpie.typedefs.AccessControlListType Grant access to :term:`Request User` according to its relationship to :term:`Context User`. If it is the same user (either from explicit name or by :py:data:`magpie.constants.MAGPIE_LOGGED_USER` reserved keyword), allow :py:data:`magpie.constants.MAGPIE_LOGGED_PERMISSION` for itself to access corresponding views. If request user is unauthenticated (``None``), :py:data:`magpie.constants.MAGPIE_LOGGED_USER` or itself, also grant :py:data:`magpie.constants.MAGPIE_CONTEXT_PERMISSION` to allow access to contextually-available details (e.g.: user can view his own information and public ones). All ACL permissions from :class:`RootFactory` are applied on top of user-specific permissions added here. .. py:function:: get_logger(name: magpie.typedefs.Str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[magpie.typedefs.Str] = None, datetime_format: Optional[magpie.typedefs.Str] = None) -> logging.Logger Immediately sets the logger level to avoid duplicate log outputs from the `root logger` and `this logger` when `level` is ``logging.NOTSET``. .. py:data:: LOGGER .. py:function:: includeme(config)