mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:17:09 +00:00
feature/Rename Role canGetMetrics -> canGetMetricsAtOneBank
This commit is contained in:
parent
dd8d671526
commit
86145a3051
@ -352,8 +352,8 @@ object ApiRole {
|
||||
case class CanReadMetrics (requiresBankId: Boolean = false) extends ApiRole
|
||||
lazy val canReadMetrics = CanReadMetrics()
|
||||
|
||||
case class CanGetMetrics (requiresBankId: Boolean = true) extends ApiRole
|
||||
lazy val canGetMetrics = CanGetMetrics()
|
||||
case class CanGetMetricsAtOneBank(requiresBankId: Boolean = true) extends ApiRole
|
||||
lazy val canGetMetricsAtOneBank = CanGetMetricsAtOneBank()
|
||||
|
||||
case class CanGetConfig(requiresBankId: Boolean = false) extends ApiRole
|
||||
lazy val canGetConfig = CanGetConfig()
|
||||
|
||||
@ -1617,7 +1617,7 @@ trait APIMethods500 {
|
||||
UnknownError
|
||||
),
|
||||
List(apiTagMetric, apiTagApi, apiTagNewStyle),
|
||||
Some(List(canGetMetrics)))
|
||||
Some(List(canGetMetricsAtOneBank)))
|
||||
|
||||
lazy val getMetricsAtBank : OBPEndpoint = {
|
||||
case "management" :: "metrics" :: "banks" :: bankId :: Nil JsonGet _ => {
|
||||
|
||||
@ -27,7 +27,7 @@ TESOBE (http://www.tesobe.com/)
|
||||
package code.api.v5_0_0
|
||||
|
||||
import code.api.util.APIUtil.OAuth._
|
||||
import code.api.util.ApiRole.CanGetMetrics
|
||||
import code.api.util.ApiRole.CanGetMetricsAtOneBank
|
||||
import code.api.util.ErrorMessages.{UserHasMissingRoles, UserNotLoggedIn}
|
||||
import code.api.v2_1_0.MetricsJson
|
||||
import code.api.v5_0_0.APIMethods500.Implementations5_0_0
|
||||
@ -79,13 +79,13 @@ class MetricsTest extends V500ServerSetup {
|
||||
val response400 = getMetrics(user1, bankId)
|
||||
Then("We should get a 403")
|
||||
response400.code should equal(403)
|
||||
response400.body.extract[ErrorMessage].message contains (UserHasMissingRoles + CanGetMetrics) should be (true)
|
||||
response400.body.extract[ErrorMessage].message contains (UserHasMissingRoles + CanGetMetricsAtOneBank) should be (true)
|
||||
}
|
||||
}
|
||||
feature(s"test $ApiEndpoint1 version $VersionOfApi - Authorized access with proper Role") {
|
||||
scenario("We will call the endpoint without user credentials", ApiEndpoint1, VersionOfApi) {
|
||||
When(s"We make a request $ApiEndpoint1")
|
||||
Entitlement.entitlement.vend.addEntitlement(bankId, resourceUser1.userId, CanGetMetrics.toString)
|
||||
Entitlement.entitlement.vend.addEntitlement(bankId, resourceUser1.userId, CanGetMetricsAtOneBank.toString)
|
||||
val response400 = getMetrics(user1, bankId)
|
||||
Then("We should get a 200")
|
||||
response400.code should equal(200)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user