magpie.api.management.network.remote_user.remote_user_utils

Functions

_remote_user_from_names(→ magpie.models.NetworkRemoteUser)

Return the NetworkRemoteUser with the same name as remote_user_name associated

requested_remote_user(→ magpie.models.NetworkRemoteUser)

Return the NetworkRemoteUser identified by the request path.

check_remote_user_access_permissions(→ None)

Raises an error if the currently logged-in user has permission to view/modify the remote_user model.

Module Contents

magpie.api.management.network.remote_user.remote_user_utils._remote_user_from_names(node_name: magpie.typedefs.Str, remote_user_name: magpie.typedefs.Str, db_session: magpie.typedefs.Session) magpie.models.NetworkRemoteUser[source]

Return the NetworkRemoteUser with the same name as remote_user_name associated with the NetworkNode named node_name.

magpie.api.management.network.remote_user.remote_user_utils.requested_remote_user(request: pyramid.request.Request) magpie.models.NetworkRemoteUser[source]

Return the NetworkRemoteUser identified by the request path.

For example: if the current request contains the path /nodes/nodeA/remote_users/userB this will return the NetworkRemoteUser with the name userB that is associated with the NetworkNode with the name nodeA.

magpie.api.management.network.remote_user.remote_user_utils.check_remote_user_access_permissions(request: pyramid.request.Request, remote_user: magpie.models.NetworkRemoteUser | None = None) None[source]

Raises an error if the currently logged-in user has permission to view/modify the remote_user model. If remote_user is None, the requested remote user will be extracted from the request path.

Admins are allowed to access any model. Other users are only allowed to access those that they are associated with.