Skip to content

Commit f9a641b

Browse files
committed
[PROD-14305] Some fixes after rebase + change deleteSolutionParameter permission requirement
1 parent 1db4152 commit f9a641b

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

solution/src/integrationTest/kotlin/com/cosmotech/solution/service/SolutionServiceIntegrationTest.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
960960
assertEquals("parameterName", solutionSaved.parameters[0].id)
961961
assertEquals("string", solutionSaved.parameters[0].varType)
962962
assertEquals(solutionParameterGroups, solutionSaved.parameterGroups)
963-
assertNotNull(solutionSaved.sdkVersion)
964963
assertEquals(csmSimulator, solutionSaved.csmSimulator)
965964
assertEquals(solutionUrl, solutionSaved.url)
966965
assertEquals(ROLE_ADMIN, solutionSaved.security.default)
@@ -1012,7 +1011,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
10121011
val updatedDescription = "new description"
10131012
val updatedTags = mutableListOf("newTag1", "newTag2")
10141013
val updatedRepository = "new_repo"
1015-
val updatedSdkVersion = "2.0.0"
10161014
val updatedCsmSimulator = "new_simulator"
10171015
val newUrl = "new_url"
10181016
val newVersion = "20.0.0"
@@ -1024,7 +1022,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
10241022
tags = updatedTags,
10251023
alwaysPull = false,
10261024
repository = updatedRepository,
1027-
sdkVersion = updatedSdkVersion,
10281025
csmSimulator = updatedCsmSimulator,
10291026
parameters =
10301027
mutableListOf(
@@ -1042,7 +1039,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
10421039
assertEquals(updatedDescription, solutionSaved.description)
10431040
assertEquals(updatedTags, solutionSaved.tags)
10441041
assertEquals(updatedRepository, solutionSaved.repository)
1045-
assertNotNull(solutionSaved.sdkVersion)
10461042
assertEquals(updatedCsmSimulator, solutionSaved.csmSimulator)
10471043
assertEquals(solutionRunTemplates, solutionSaved.runTemplates)
10481044
assertEquals(newUrl, solutionSaved.url)
@@ -1099,7 +1095,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
10991095
val updatedDescription = "new description"
11001096
val updatedTags = mutableListOf("newTag1", "newTag2")
11011097
val updatedRepository = "new_repo"
1102-
val updatedSdkVersion = "2.0.0"
11031098
val updatedCsmSimulator = "new_simulator"
11041099
val newUrl = "new_url"
11051100
val newVersion = "20.0.0"
@@ -1111,7 +1106,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
11111106
tags = updatedTags,
11121107
alwaysPull = false,
11131108
repository = updatedRepository,
1114-
sdkVersion = updatedSdkVersion,
11151109
csmSimulator = updatedCsmSimulator,
11161110
url = newUrl,
11171111
version = newVersion)
@@ -1125,7 +1119,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
11251119
assertEquals(updatedDescription, solutionSaved.description)
11261120
assertEquals(updatedTags, solutionSaved.tags)
11271121
assertEquals(updatedRepository, solutionSaved.repository)
1128-
assertNotNull(solutionSaved.sdkVersion)
11291122
assertEquals(updatedCsmSimulator, solutionSaved.csmSimulator)
11301123
assertEquals(solutionRunTemplates, solutionSaved.runTemplates)
11311124
assertEquals(newUrl, solutionSaved.url)
@@ -1150,7 +1143,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
11501143
val solutionParameterGroups = mutableListOf(RunTemplateParameterGroup(id = "group"))
11511144
val csmSimulator = "simulator"
11521145
val solutionRepository = "repository"
1153-
val sdkVersion = "10.0.0"
11541146

11551147
val solutionCreateRequest =
11561148
SolutionCreateRequest(
@@ -1170,7 +1162,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
11701162
default = ROLE_ADMIN,
11711163
accessControlList =
11721164
mutableListOf(SolutionAccessControl("user_id", ROLE_ADMIN))),
1173-
sdkVersion = sdkVersion,
11741165
csmSimulator = csmSimulator,
11751166
url = solutionUrl,
11761167
alwaysPull = true,
@@ -1182,7 +1173,6 @@ class SolutionServiceIntegrationTest : CsmRedisTestBase() {
11821173
val updatedDescription = "new description"
11831174
val updatedTags = mutableListOf("newTag1", "newTag2")
11841175
val updatedRepository = "new_repo"
1185-
val updatedSdkVersion = "2.0.0"
11861176
val updatedCsmSimulator = "new_simulator"
11871177
val newUrl = "new_url"
11881178
val newVersion = "20.0.0"

solution/src/integrationTest/kotlin/com/cosmotech/solution/service/SolutionServiceRBACTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ class SolutionServiceRBACTest : CsmRedisTestBase() {
16031603
fun `test RBAC delete solution parameter`() =
16041604
mapOf(
16051605
ROLE_VIEWER to true,
1606-
ROLE_EDITOR to true,
1606+
ROLE_EDITOR to false,
16071607
ROLE_USER to true,
16081608
ROLE_NONE to true,
16091609
ROLE_ADMIN to false,
@@ -1627,7 +1627,7 @@ class SolutionServiceRBACTest : CsmRedisTestBase() {
16271627
organizationSaved.id, solutionSaved.id, "parameter")
16281628
}
16291629
assertEquals(
1630-
"RBAC ${solutionSaved.id} - User does not have permission $PERMISSION_DELETE",
1630+
"RBAC ${solutionSaved.id} - User does not have permission $PERMISSION_WRITE",
16311631
exception.message)
16321632
} else {
16331633
assertDoesNotThrow {

solution/src/main/kotlin/com/cosmotech/solution/service/SolutionServiceImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ class SolutionServiceImpl(
444444
solutionId: String,
445445
parameterId: String
446446
) {
447-
val solution = getVerifiedSolution(organizationId, solutionId, PERMISSION_DELETE)
447+
val solution = getVerifiedSolution(organizationId, solutionId, PERMISSION_WRITE)
448448
val solutionParameter =
449449
solution.parameters.firstOrNull { it.id == parameterId }
450450
?: throw CsmResourceNotFoundException(

0 commit comments

Comments
 (0)