Module auth

Source

Structs§

NewPermissions
A new set of permissions to assign to a document.
Permissions
Permissions set on a document.
UserPermissions
Permissions of a user on a document.

Enums§

PermissionLevel
Levels of permission that a user can have on a document.

Functions§

authenticate_from_request
Extracts an authenticated user from an HTTP request.
authorize
Verify that user is authorized to access a ref at a given permission level.
is_authorized
Is the user authorized to access a ref at a given permission level?
max_permission_level
Gets the highest level of permissions allowed for a ref.
permissions
Gets the permissions allowed for a ref.
ref_exists 🔒
Verify that the given ref exists.
set_permissions
Replaces the set of permissions for a ref.
validate_session
Returns an error if the user_id in the session does not exist in the DB, returns None otherwise