def create_project(
conn: BlitzGateway, project_name: str, project_description: str = ""
) -> int:
"""
Creates a project on the OMERO server.
Args:
conn (BlitzGateway): The connection object to OMERO.
project_name (str): The name of the project.
project_description (str, optional): The description of the project. Defaults to "".
Returns:
int: The ID of the created project.
"""
conn.keepAlive()
project = ProjectI()
project.name = rstring(project_name)
project.description = rstring(project_description)
update_service = conn.getUpdateService()
project = update_service.saveAndReturnObject(project)
return project.id.val
async def create_omero_project(
username: str,
password: str,
project_name: str,
project_description: str = "",
) -> int:
try:
conn = connect(system_config.OMERO_HOST, username, password)
except Exception as e:
logger.error(f"Failed to connect to OMERO server: {str(e)}")
raise HTTPException(status_code=500, detail="Failed to connect to OMERO server")
try:
project_id = create_project(conn, project_name, project_description)
return project_id
except Exception as e:
logger.error(f"Error creating project: {str(e)}")
raise HTTPException(status_code=500, detail=f"Error creating project: {str(e)}")
finally:
conn.close()
create_omero_project is connecting to omero server with credentials we set and executes create_project
create_projects creates project and owner of this project will be the user whose credentials we used for the connection.
if we connect through a user with admin permissions, then do we have the opportunity to create a project with different owner (not user from which we connect)?
i have a functions:
create_omero_project is connecting to omero server with credentials we set and executes create_project
create_projects creates project and owner of this project will be the user whose credentials we used for the connection.
if we connect through a user with admin permissions, then do we have the opportunity to create a project with different owner (not user from which we connect)?