refactor/tweak the role name to CanGetApiCollectionsForUser

This commit is contained in:
Hongwei 2022-12-21 15:11:28 +01:00
parent e95a4c3310
commit ebb7d54564
3 changed files with 4 additions and 4 deletions

View File

@ -323,8 +323,8 @@ object ApiRole {
case class CanGetApiCollection(requiresBankId: Boolean = false) extends ApiRole
lazy val canGetApiCollection = CanGetApiCollection()
case class CanGetAllApiCollectionsForUser(requiresBankId: Boolean = false) extends ApiRole
lazy val canGetAllApiCollectionsForUser = CanGetAllApiCollectionsForUser()
case class CanGetApiCollectionsForUser(requiresBankId: Boolean = false) extends ApiRole
lazy val canGetApiCollectionsForUser = CanGetApiCollectionsForUser()
case class CanGetAllApiCollections(requiresBankId: Boolean = false) extends ApiRole
lazy val canGetAllApiCollections = CanGetAllApiCollections()

View File

@ -9065,7 +9065,7 @@ trait APIMethods400 {
UnknownError
),
List(apiTagApiCollection, apiTagNewStyle),
Some(canGetAllApiCollectionsForUser :: Nil)
Some(canGetApiCollectionsForUser :: Nil)
)
lazy val getApiCollectionsForUser: OBPEndpoint = {

View File

@ -232,7 +232,7 @@ class ApiCollectionTest extends V400ServerSetup {
responseApiEndpoint6.body.toString contains(s"$UserHasMissingRoles") should be (true)
Then("grant the role and test it again")
Entitlement.entitlement.vend.addEntitlement("", resourceUser1.userId, ApiRole.canGetAllApiCollectionsForUser.toString)
Entitlement.entitlement.vend.addEntitlement("", resourceUser1.userId, ApiRole.canGetApiCollectionsForUser.toString)
val responseApiEndpoint6WithRole = makeGetRequest(requestApiEndpoint6)
Then("We should get a 200")