diff options
5 files changed, 32 insertions, 9 deletions
diff --git a/features.properties.md b/features.properties.md index a0f7e2555..54be31b1a 100644 --- a/features.properties.md +++ b/features.properties.md @@ -215,6 +215,10 @@ When flag is true the user will be provided with edit permissions by owning entity id even the user have no permission by Subscriber, when the flag is false the user provided with edit permission by Subscriber. +* FLAG_2006_LIMIT_OWNING_ENTITY_SELECTION_BY_ROLES + While service instantiation, when flag is enabled, a user will not be able to choose Owning Entity which she has no + matching role for. Relevant roles can be provided by using FLAG_2006_USER_PERMISSIONS_BY_OWNING_ENTITY. + * FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF When flag is true new VF Modules on Alacarte service will inherit LCP-Region and Tenant from parent VNF. When off, user is requested to specify LCP-Region and Tenant for each VF Module.
\ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java index cc3fad65e..219b65def 100644 --- a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java +++ b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java @@ -86,6 +86,7 @@ public enum Features implements Feature { FLAG_2002_UNLIMITED_MAX, FLAG_MORE_AUDIT_INFO_LINK_ON_AUDIT_INFO, FLAG_2006_USER_PERMISSIONS_BY_OWNING_ENTITY, + FLAG_2006_LIMIT_OWNING_ENTITY_SELECTION_BY_ROLES, FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF, ; diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceWithRoles.kt b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceWithRoles.kt index f059e590c..c9b9d1417 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceWithRoles.kt +++ b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceWithRoles.kt @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore import org.onap.vid.category.CategoryParameterOptionRep import org.onap.vid.category.CategoryParametersResponse import org.onap.vid.model.CategoryParameter +import org.onap.vid.properties.Features import org.onap.vid.roles.RoleProvider import org.onap.vid.roles.WithPermissionPropertiesOwningEntity import org.springframework.beans.factory.annotation.Qualifier @@ -22,7 +23,7 @@ class CategoryParameterServiceWithRoles( private val owningEntityKey = "owningEntity" - private fun shouldTreatPermissions() = false + private fun shouldTreatPermissions() = featureManager.isActive(Features.FLAG_2006_LIMIT_OWNING_ENTITY_SELECTION_BY_ROLES) override fun getCategoryParameters(familyName: CategoryParameter.Family?): CategoryParametersResponse { val categoryParameters = @@ -50,10 +51,11 @@ class CategoryParameterServiceWithRoles( ?.filter { userRolesValidator.isServicePermitted(it) } } - - class OwningEntityOptionRep(categoryParameterOptionRep: CategoryParameterOptionRep) : - CategoryParameterOptionRep(categoryParameterOptionRep.id, categoryParameterOptionRep.name), - WithPermissionPropertiesOwningEntity { + /** + * Encapsulates a CategoryParameterOptionRep where id field contains an owningEntityId + */ + class OwningEntityOptionRep(option: CategoryParameterOptionRep) : + CategoryParameterOptionRep(option.id, option.name), WithPermissionPropertiesOwningEntity { override val owningEntityId: String? @JsonIgnore get() = id } diff --git a/vid-automation/conf/users b/vid-automation/conf/users index de18c38d7..648b661a5 100644 --- a/vid-automation/conf/users +++ b/vid-automation/conf/users @@ -13,7 +13,10 @@ "userId": "1", "password": "1" }, - "roles": ["SILVIA ROBBINS___TYLER SILVIA", "SILVIA ROBBINS___DARREN MCGEE", "CAR_2020_ER___DARREN MCGEE", "CAR_2020_ER___MSO-dev-service-type", "CAR_2020_ER___TYLER SILVIA","READ___LOGS___PERMITTED","Emanuel___mySubType", "global-customer-id___service-instance-type"], + "roles": [ + "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "SILVIA ROBBINS___TYLER SILVIA", "SILVIA ROBBINS___DARREN MCGEE", "CAR_2020_ER___DARREN MCGEE", "CAR_2020_ER___MSO-dev-service-type", "CAR_2020_ER___TYLER SILVIA","READ___LOGS___PERMITTED","Emanuel___mySubType", "global-customer-id___service-instance-type" + ], "subscriberNames": ["SILVIA ROBBINS", "CAR_2020_ER", "Emanuel", "global-customer-id"], "serviceTypes": ["TYLER SILVIA", "DARREN MCGEE", "MSO-dev-service-type"], "tenants": ["092eb9e8e4b7412e8787dd091bc58e86"] @@ -23,7 +26,10 @@ "userId": "3", "password": "3" }, - "roles": ["Emanuel___Emanuel"], + "roles": [ + "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "Emanuel___Emanuel" + ], "subscriberNames": ["Emanuel"], "serviceTypes": ["Emanuel"], "tenants": ["c630e297a3ae486497d63eacec1d7c14", "d3b49834f7164cbe831bfbfa35ef649b"] @@ -33,7 +39,10 @@ "userId": "667", "password": "667" }, - "roles": ["CRAIG/ROBERTS___AIM Transport"], + "roles": [ + "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "CRAIG/ROBERTS___AIM Transport" + ], "subscriberNames": ["CRAIG/ROBERTS"], "serviceTypes": ["AIM Transport"], "tenants": null @@ -43,7 +52,10 @@ "userId": "4", "password": "4" }, - "roles": ["Emanuel___vWINIFRED", "Emanuel___vRichardson"], + "roles": [ + "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", + "Emanuel___vWINIFRED", "Emanuel___vRichardson" + ], "subscriberNames": ["Emanuel"], "serviceTypes": ["vWINIFRED", "vRichardson"], "tenants": ["092eb9e8e4b7412e8787dd091bc58e86"] @@ -54,6 +66,7 @@ "password": "822" }, "roles": [ + "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", "JULIO ERICKSON___Emanuel", "JULIO ERICKSON___vRichardson" @@ -68,6 +81,7 @@ "password": "312" }, "roles": [ + "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", "Emanuel___vRichardson" ], "subscriberNames": ["Emanuel"], @@ -80,6 +94,7 @@ "password": "312" }, "roles": [ + "d61e6f2d-12fa-4cc2-91df-7c244011d6fc___LOB", "Melissa___LOB", "aaa1___LOB", "Emanuel___vWINIFRED___test-hvf6-09" ], "subscriberNames": ["Emanuel"], diff --git a/vid-automation/src/main/java/vid/automation/test/infra/Features.java b/vid-automation/src/main/java/vid/automation/test/infra/Features.java index ddf0baddb..ff06bf98e 100644 --- a/vid-automation/src/main/java/vid/automation/test/infra/Features.java +++ b/vid-automation/src/main/java/vid/automation/test/infra/Features.java @@ -59,6 +59,7 @@ public enum Features implements Feature { FLAG_2004_INSTANTIATION_TEMPLATES_POPUP, FLAG_2006_VFM_SDNC_PRELOAD_FILES, FLAG_2006_USER_PERMISSIONS_BY_OWNING_ENTITY, + FLAG_2006_LIMIT_OWNING_ENTITY_SELECTION_BY_ROLES, FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF, ; |