Skip to content

Commit

Permalink
Allow to delete network service subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Jan 6, 2020
1 parent bc63653 commit 0faa846
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Customer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,26 @@ trait Customer {
}
}

Boolean deleteCustomerNetServiceAccess(def subjServId) {
try {
logger.info("Deleting customer net service subscription id ${subjServId}")
hid.execute('SI_SUBJECTS_PKG.SI_SUBJ_SERVICES_DEL', [
num_N_SUBJ_SERV_ID : subjServId
])
logger.info(" Net service subscription was deleted successfully!")
return true
} catch (Exception e){
logger.error(" Error while deleting net service subscription!")
logger.error_oracle(e)
return false
}
}

Boolean deleteCustomerNetServiceAccess(Map input) {
def subjServId = getCustomerNetServiceAccessBy(input)?.n_subj_serv_id
return deleteCustomerNetServiceAccess(subjServId)
}

List getCustomerAppsAccessBy(Map input) {
LinkedHashMap params = mergeParams([
subjServId : null,
Expand All @@ -521,7 +541,7 @@ trait Customer {
passwordHash : null,
hashTypeId : null
], input)
return getCustomerNetServicesAccessBy(params + [netServiceId: params.appId])
return getCustomerNetServicesAccessBy(params + [netServiceId: params.applicationId ?: params.appId])
}

Map getCustomerAppAccessBy(Map input) {
Expand Down Expand Up @@ -579,6 +599,15 @@ trait Customer {
return changeNetServicePassword(input)
}

Boolean deleteCustomerAppAccess(def subjServId) {
return deleteCustomerNetServiceAccess(subjServId)
}

Boolean deleteCustomerAppAccess(Map input) {
def subjServId = getCustomerAppAccessBy(input)?.n_subj_serv_id
return deleteCustomerAppAccess(subjServId)
}

Map getCustomerSelfCareAccessBy(Map input) {
input.appId = getSelfCareAppId()
return getCustomerAppAccessBy(input)
Expand Down Expand Up @@ -623,7 +652,12 @@ trait Customer {
}

Boolean changeSelfCarePassword(Map input) {
return changeNetServicePassword(input)
return changeAppPassword(input + [appId: getSelfCareApplicationId()])
}

Boolean deleteCustomerSelfCareAccess(def customerId) {
def subjServId = getCustomerAppAccessBy(customerId: customerId, appId: getSelfCareApplicationId())?.n_subj_serv_id
return deleteCustomerAppAccess(subjServId)
}

Boolean processCustomer(
Expand Down

0 comments on commit 0faa846

Please sign in to comment.