routers.documents
Module for the methods regarding the documents
Module Contents
Functions
|
Add a document schema to a project |
|
Add or update content of document |
|
Patch content of document |
|
Get specified content in path of field of document |
|
Post content in path of document content |
|
Delete document of project |
|
Add user permissions to document |
|
Deletes user permissions of document |
|
Gets user permissions of document |
Attributes
- routers.documents.router
- async routers.documents.add_document_schema_to_project(request_body=Depends(get_request_body), user=Depends(get_current_active_user), db_project=Depends(get_project), session=Depends(get_session))
Add a document schema to a project Requires the authenticated user to have the permission to create a document
- Parameters
request_body (dependencies.Dict) – schema to add
user (dependencies.User) – current user from dependencies
db_project (dependencies.Project) – project of path from dependencies
session (dependencies.Session) – session from dependencies
- Returns
the document added
- async routers.documents.put_document_to_project(document_body=Depends(get_request_body), user=Depends(get_current_active_user), db_project=Depends(get_project), db_doc=Depends(get_document), session=Depends(get_session))
Add or update content of document Requires the authenticated user to have the permission to edit the document
- Parameters
document_body (dependencies.Dict) – document content to add or update
user (dependencies.User) – current user from dependencies
db_project (dependencies.Project) – project of path from dependencies
db_doc (dependencies.Document) – document of path from dependencies
session (dependencies.Session) – session from dependencies
- Returns
the document
- async routers.documents.patch_document_of_project(document_body=Depends(get_request_body), user=Depends(get_current_active_user), db_project=Depends(get_project), db_doc=Depends(get_document), session=Depends(get_session))
Patch content of document Requires the authenticated user to have the permission to edit the document
- Parameters
document_body (dependencies.Dict) – document content to patch
user (dependencies.User) – current user from dependencies
db_project (dependencies.Project) – project of path from dependencies
db_doc (dependencies.Document) – document of path from dependencies
session (dependencies.Session) – session from dependencies
- Returns
the document
- routers.documents.get_document_of_project(field=None, path=None, db_doc=Depends(get_document))
Get specified content in path of field of document Requires the authenticated user to have the permission to view the document
- Parameters
field (str | None) – field of document
path (str | None) – path in field
db_doc (dependencies.Document) – document of path from dependencies
- Returns
content in path of field of document
- async routers.documents.post_path_document_of_project(path=None, session=Depends(get_session), user=Depends(get_current_active_user), document_body=Depends(get_request_body), db_project=Depends(get_project), db_doc=Depends(get_document))
Post content in path of document content Requires the authenticated user to have the permission to edit the document
- Parameters
path (str | None) – path in document content
session (dependencies.Session) – session from dependencies
user (dependencies.User) – current user from dependencies
document_body (dependencies.Dict) – document content to post
db_project (dependencies.Project) – project of path from dependencies
db_doc (dependencies.Document) – document of path from dependencies
- Returns
the document
- routers.documents.delete_document_of_project(db_doc=Depends(get_document), session=Depends(get_session))
Delete document of project Requires the authenticated user to have the permission to delete the document
- Parameters
db_doc (dependencies.Document) –
session (dependencies.Session) –
- Returns
200 OK if document is deleted, else the corresponding error
- routers.documents.add_document_permissions(doc_permissions, db_project=Depends(get_project), db_doc=Depends(get_document), session=Depends(get_session))
Add user permissions to document Requires the authenticated user to have the permission to edit the document permissions
- Parameters
doc_permissions (datatypes.models.DocumentPermissionsInput) – permissions to add
db_project (dependencies.Project) – project of path from dependencies
db_doc (dependencies.Document) – document of path from dependencies
session (dependencies.Session) – session from dependencies
- Returns
current user permissions of the document
- routers.documents.delete_document_permissions(doc_permissions, db_project=Depends(get_project), db_doc=Depends(get_document), session=Depends(get_session))
Deletes user permissions of document Requires the authenticated user to have the permission to edit the document permissions
- Parameters
doc_permissions (datatypes.models.DocumentPermissionsInput) – permissions to delete
db_project (dependencies.Project) – project of path from dependencies
db_doc (dependencies.Document) – document of path from dependencies
session (dependencies.Session) – session from dependencies
- Returns
current user permissions of the document
- routers.documents.get_document_permissions_for_user(user_name, db_project=Depends(get_project), db_doc=Depends(get_document), session=Depends(get_session))
Gets user permissions of document Requires the authenticated user to have the permission to edit the document permissions
- Parameters
user_name (str) – user name of permissions to get
db_project (dependencies.Project) – project of path from dependencies
db_doc (dependencies.Document) – document of path from dependencies
session (dependencies.Session) – session from dependencies
- Returns
current user permissions of the document