mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:17:09 +00:00
extract the addedSuperAdminEntitlementJson method
This commit is contained in:
parent
2f4346501e
commit
8477a22ee6
@ -2045,7 +2045,7 @@ trait APIMethods200 {
|
||||
// Format the data as V2.0.0 json
|
||||
if (isSuperAdmin(userId)) {
|
||||
// If the user is SuperAdmin add it to the list
|
||||
json = EntitlementJSONs(JSONFactory200.createEntitlementJSONs(entitlements).list:::List(EntitlementJSON("", "SuperAdmin", "")))
|
||||
json = addedSuperAdminEntitlementJson(entitlements)
|
||||
successJsonResponse(Extraction.decompose(json))
|
||||
} else {
|
||||
json = JSONFactory200.createEntitlementJSONs(entitlements)
|
||||
|
||||
@ -837,6 +837,10 @@ def createTransactionTypeJSON(transactionType : TransactionType) : TransactionTy
|
||||
))
|
||||
)))
|
||||
|
||||
def addedSuperAdminEntitlementJson(entitlements: List[Entitlement]) = {
|
||||
EntitlementJSONs(JSONFactory200.createEntitlementJSONs(entitlements).list ::: List(EntitlementJSON("", "SuperAdmin", "")))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -821,7 +821,7 @@ trait APIMethods210 {
|
||||
// Format the data as V2.1.0 json
|
||||
if (isSuperAdmin(userId)) {
|
||||
// If the user is SuperAdmin add it to the list
|
||||
json = EntitlementJSONs(JSONFactory200.createEntitlementJSONs(filteredEntitlements).list:::List(EntitlementJSON("", "SuperAdmin", "")))
|
||||
json = JSONFactory200.addedSuperAdminEntitlementJson(filteredEntitlements)
|
||||
successJsonResponse(Extraction.decompose(json))
|
||||
} else {
|
||||
json = JSONFactory200.createEntitlementJSONs(filteredEntitlements)
|
||||
|
||||
@ -1326,7 +1326,7 @@ trait APIMethods400 {
|
||||
// Format the data as V2.0.0 json
|
||||
if (isSuperAdmin(userId)) {
|
||||
// If the user is SuperAdmin add it to the list
|
||||
json = EntitlementJSONs(JSONFactory200.createEntitlementJSONs(entitlements).list:::List(EntitlementJSON("", "SuperAdmin", "")))
|
||||
json = JSONFactory200.addedSuperAdminEntitlementJson(entitlements)
|
||||
} else {
|
||||
json = JSONFactory200.createEntitlementJSONs(entitlements)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user