routers.projects
Module for the methods regarding projects
Module Contents
Functions
|
Returns a list of all projects that the user has access to |
|
Creates a new project with the data in the body |
|
Get project by name |
|
Delete project by name |
|
Add user permissions to project |
|
Delete user permissions from project |
|
Get permissions of specified user in project |
Attributes
- routers.projects.router
- routers.projects.get_projects(session=Depends(get_session), user=Depends(get_current_active_user))
Returns a list of all projects that the user has access to
- Parameters
session (dependencies.Session) – session from dependencies
user (dependencies.User) – current user from dependencies
- Returns
list of project names
- async routers.projects.create_project(user=Depends(get_current_active_user), project_body=Depends(get_request_body), session=Depends(get_session))
Creates a new project with the data in the body Requires the authenticated user to have the permission to create projects
- Parameters
user (dependencies.User) – current user from dependencies
project_body (dependencies.Dict) – project data from body
session (dependencies.Session) – session from dependencies
- Returns
created project
- routers.projects.get_project_by_name(session=Depends(get_session), user=Depends(get_current_active_user), db_project=Depends(get_project))
Get project by name Requires the authenticated user to have the permission to view the project
- Parameters
session (dependencies.Session) – session from dependencies
user (dependencies.User) – current user from dependencies
db_project (dependencies.Project) – project of path from dependencies
- Returns
project
- routers.projects.delete_project_by_name(session=Depends(get_session), db_project=Depends(get_project))
Delete project by name Requires the authenticated user to have the permission to delete the project
- Parameters
session (dependencies.Session) – session from dependencies
db_project (dependencies.Project) – project of path from dependencies
- Returns
200 OK if project was deleted, else the corresponding error
- routers.projects.add_project_permissions(proj_permissions, session=Depends(get_session), db_project=Depends(get_project))
Add user permissions to project Requires the authenticated user to have the permission to edit permissions
- Parameters
proj_permissions (datatypes.models.ProjectPermissionsInput) – permissions to add
session (dependencies.Session) – session from dependencies
db_project (dependencies.Project) – project of path from dependencies
- Returns
current project permissions of user
- routers.projects.delete_project_permissions(proj_permissions, session=Depends(get_session), db_project=Depends(get_project))
Delete user permissions from project Requires the authenticated user to have the permission to edit permissions
- Parameters
proj_permissions (datatypes.models.ProjectPermissionsInput) – permissions to delete
session (dependencies.Session) – session from dependencies
db_project (dependencies.Project) – project of path from dependencies
- Returns
current project permissions of user
- routers.projects.get_project_permissions(user_name, session=Depends(get_session), db_project=Depends(get_project))
Get permissions of specified user in project Requires the authenticated user to have the permission to edit permissions
- Parameters
user_name (str) – user to get permissions for
session (dependencies.Session) – session from dependencies
db_project (dependencies.Project) – project of path from dependencies
- Returns
permissions of user in project