You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(status = 200, description = "Organization with the id that was requested", body = OrganizationWithSubAndPlan),
28
+
(status = 200, description = "Public Page associated to the dataset", body = OrganizationWithSubAndPlan),
22
29
(status = 400, description = "Service error relating to finding the organization by id", body = ErrorResponseBody),
23
30
(status = 404, description = "Organization not found", body = ErrorResponseBody)
24
31
),
@@ -30,9 +37,10 @@ pub async fn public_page(
30
37
page_params: web::Query<PublicPageParams>,
31
38
pool: web::Data<Pool>,
32
39
templates:Templates<'_>,
33
-
) -> Result<HttpResponse, actix_web::Error>{
34
-
35
-
let dataset_id = page_params.dataset_id;
40
+
) -> Result<HttpResponse,ServiceError>{
41
+
letSome(dataset_id) = page_params.dataset_idelse{
42
+
returnOk(HttpResponse::NotFound().finish());
43
+
};
36
44
37
45
let page = get_page_by_dataset_id(dataset_id, pool).await?;
38
46
@@ -54,3 +62,55 @@ pub async fn public_page(
54
62
Ok(HttpResponse::Forbidden().finish())
55
63
}
56
64
}
65
+
66
+
#[derive(Deserialize)]
67
+
#[serde(rename_all = "camelCase")]
68
+
pubstructSetDatasetVisibilityPayload{
69
+
pubis_public:bool,
70
+
pubapi_key_params:SetUserApiKeyRequest,
71
+
}
72
+
73
+
#[utoipa::path(
74
+
put,
75
+
path = "/dataset/visibility",
76
+
context_path = "/api",
77
+
tag = "Public",
78
+
responses(
79
+
(status = 200, description = "Public Page associated to the dataset", body = OrganizationWithSubAndPlan),
80
+
(status = 400, description = "Service error relating to finding the organization by id", body = ErrorResponseBody),
81
+
(status = 404, description = "Organization not found", body = ErrorResponseBody)
82
+
),
83
+
params(
84
+
("TR-Dataset" = uuid::Uuid,Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."),
85
+
("datasetId" = Option<uuid::Uuid>,Path, description = "The id of the organization you want to fetch."),
Copy file name to clipboardExpand all lines: server/src/handlers/user_handler.rs
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -107,15 +107,15 @@ pub async fn update_user(
107
107
#[derive(Debug,Serialize,Deserialize,ToSchema)]
108
108
pubstructSetUserApiKeyRequest{
109
109
/// The name which will be assigned to the new api key.
110
-
name:String,
110
+
pubname:String,
111
111
/// The role which will be assigned to the new api key. Either 0 (read), 1 (read and write at the level of the currently auth'ed user). The auth'ed user must have a role greater than or equal to the role being assigned which means they must be an admin (1) or owner (2) of the organization to assign write permissions with a role of 1.
112
-
role:i32,
112
+
pubrole:i32,
113
113
/// The dataset ids which the api key will have access to. If not provided or empty, the api key will have access to all datasets the auth'ed user has access to. If both dataset_ids and organization_ids are provided, the api key will have access to the intersection of the datasets and organizations.
114
-
dataset_ids:Option<Vec<uuid::Uuid>>,
114
+
pubdataset_ids:Option<Vec<uuid::Uuid>>,
115
115
/// The organization ids which the api key will have access to. If not provided or empty, the api key will have access to all organizations the auth'ed user has access to.
116
-
organization_ids:Option<Vec<uuid::Uuid>>,
116
+
puborganization_ids:Option<Vec<uuid::Uuid>>,
117
117
/// The routes which the api key will have access to. If not provided or empty, the api key will have access to all routes the auth'ed user has access to. Specify the routes as a list of strings. For example, ["GET /api/dataset", "POST /api/dataset"].
0 commit comments