From e9a8f467f1d805348df66c6a4bee1d145fdd85db Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Wed, 17 Jul 2024 14:19:39 +0200 Subject: rest: add GET,POST /image/restrict Allow to restrict image to scope: POST /image/restrict { "image" : 49, "scopes" : [ 1,3 ] } response: 200 OK This restricts image with ID 49 to scopes 1 and 3. You can also fetch the current list of restrictions: GET /image/restrict { "image" : 49 } response: 200 OK { "image" : 49, "scopes" : [ 1,3 ] } Existing limitations in this interface: - Only restriction of image to center is possible at this moment. - This is only used by ogCP to validate if this is possible, no existing code in the ogserver uses this to restrict POST image/restore. This is a usability feature. --- src/rest.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/rest.h') diff --git a/src/rest.h b/src/rest.h index f70af75..61169fe 100644 --- a/src/rest.h +++ b/src/rest.h @@ -37,6 +37,7 @@ enum og_cmd_type { OG_CMD_IMAGE_CREATE, OG_CMD_IMAGE_UPDATE, OG_CMD_IMAGE_RESTORE, + OG_CMD_IMAGE_RESTRICT, OG_CMD_SETUP, OG_CMD_RUN_SCHEDULE, OG_CMD_IMAGES, @@ -124,6 +125,7 @@ enum og_rest_uri { OG_URI_IMAGE_UPDATE, OG_URI_IMAGE_RESTORE, OG_URI_IMAGE_DELETE, + OG_URI_IMAGE_RESTRICT, OG_URI_CACHE_LIST, OG_URI_CACHE_DELETE, OG_URI_PART_SETUP, -- cgit v1.2.3-18-g5258