Skip to content

Commit f0db78d

Browse files
committed
changed permissions
1 parent 7bb2a1c commit f0db78d

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

services/web/server/src/simcore_service_webserver/functions/_controller/_functions_rpc.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
FunctionJobCollectionReadAccessDeniedError,
2323
FunctionJobCollectionsReadApiAccessDeniedError,
2424
FunctionJobCollectionsWriteApiAccessDeniedError,
25+
FunctionJobCollectionWriteAccessDeniedError,
2526
FunctionJobIDNotFoundError,
2627
FunctionJobReadAccessDeniedError,
2728
FunctionJobsReadApiAccessDeniedError,
@@ -283,6 +284,7 @@ async def delete_function_job(
283284
reraise_if_error_type=(
284285
FunctionJobCollectionIDNotFoundError,
285286
FunctionJobCollectionReadAccessDeniedError,
287+
FunctionJobCollectionWriteAccessDeniedError,
286288
FunctionJobCollectionsWriteApiAccessDeniedError,
287289
)
288290
)
@@ -305,6 +307,7 @@ async def delete_function_job_collection(
305307
reraise_if_error_type=(
306308
FunctionIDNotFoundError,
307309
FunctionReadAccessDeniedError,
310+
FunctionWriteAccessDeniedError,
308311
)
309312
)
310313
async def update_function_title(
@@ -325,7 +328,11 @@ async def update_function_title(
325328

326329

327330
@router.expose(
328-
reraise_if_error_type=(FunctionIDNotFoundError, FunctionReadAccessDeniedError)
331+
reraise_if_error_type=(
332+
FunctionIDNotFoundError,
333+
FunctionReadAccessDeniedError,
334+
FunctionWriteAccessDeniedError,
335+
)
329336
)
330337
async def update_function_description(
331338
app: web.Application,

services/web/server/tests/unit/with_dbs/04/functions_rpc/test_function_job_collections_controller_rpc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from models_library.functions_errors import (
1818
FunctionJobCollectionReadAccessDeniedError,
1919
FunctionJobCollectionsReadApiAccessDeniedError,
20+
FunctionJobCollectionWriteAccessDeniedError,
2021
FunctionJobIDNotFoundError,
2122
)
2223
from models_library.products import ProductName
@@ -137,7 +138,7 @@ async def test_function_job_collection(
137138
)
138139

139140
# Attempt to delete the function job collection by another user
140-
with pytest.raises(FunctionJobCollectionReadAccessDeniedError):
141+
with pytest.raises(FunctionJobCollectionWriteAccessDeniedError):
141142
await functions_rpc.delete_function_job_collection(
142143
rabbitmq_rpc_client=rpc_client,
143144
function_job_collection_id=registered_collection.uid,

services/web/server/tests/unit/with_dbs/04/functions_rpc/test_function_jobs_controller_rpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
FunctionJobIDNotFoundError,
1616
FunctionJobReadAccessDeniedError,
1717
FunctionJobsReadApiAccessDeniedError,
18+
FunctionJobWriteAccessDeniedError,
1819
)
1920
from models_library.products import ProductName
2021
from pytest_simcore.helpers.webserver_login import UserInfoDict
@@ -104,7 +105,7 @@ async def test_register_get_delete_function_job(
104105
product_name="this_is_not_osparc",
105106
)
106107

107-
with pytest.raises(FunctionJobReadAccessDeniedError):
108+
with pytest.raises(FunctionJobWriteAccessDeniedError):
108109
# Attempt to delete the function job by another user
109110
await functions_rpc.delete_function_job(
110111
rabbitmq_rpc_client=rpc_client,
@@ -301,7 +302,6 @@ async def test_find_cached_function_jobs(
301302
mock_function: ProjectFunction,
302303
clean_functions: None,
303304
):
304-
305305
# Register the function first
306306
registered_function = await functions_rpc.register_function(
307307
rabbitmq_rpc_client=rpc_client,

services/web/server/tests/unit/with_dbs/04/functions_rpc/test_functions_controller_rpc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
FunctionIDNotFoundError,
2020
FunctionReadAccessDeniedError,
2121
FunctionsReadApiAccessDeniedError,
22+
FunctionWriteAccessDeniedError,
2223
)
2324
from models_library.products import ProductName
2425
from pytest_simcore.helpers.webserver_login import UserInfoDict
@@ -88,7 +89,7 @@ async def test_register_get_delete_function(
8889
product_name=osparc_product_name,
8990
)
9091

91-
with pytest.raises(FunctionReadAccessDeniedError):
92+
with pytest.raises(FunctionWriteAccessDeniedError):
9293
# Attempt to delete the function by another user
9394
await functions_rpc.delete_function(
9495
rabbitmq_rpc_client=rpc_client,
@@ -374,7 +375,7 @@ async def test_update_function_title(
374375
# Update the function's title by other user
375376
updated_title = "Updated Function Title by Other User"
376377
registered_function.title = updated_title
377-
with pytest.raises(FunctionReadAccessDeniedError):
378+
with pytest.raises(FunctionWriteAccessDeniedError):
378379
updated_function = await functions_rpc.update_function_title(
379380
rabbitmq_rpc_client=rpc_client,
380381
function_id=registered_function.uid,

0 commit comments

Comments
 (0)