Skip to content

Commit

Permalink
provide capability for system admins to use zms-cli to set business s…
Browse files Browse the repository at this point in the history
…ervice (#2618)

Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
Co-authored-by: Henry Avetisyan <hga@yahooinc.com>
  • Loading branch information
havetisyan and havetisyan authored May 16, 2024
1 parent a1c2dd7 commit be08d26
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libs/go/zmscli/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,16 @@ func (cli Zms) SetDomainBusinessService(dn string, businessService string) (*str
}
err = cli.SetCompleteDomainMeta(dn, domain.Description, string(domain.Org), domainAuditEnabled, domain.ApplicationId, businessService)
if err != nil {
return nil, err
// if the operation fails we're going to try the operation as a system
// administrator who might have required authorization to set the business
// service on all domains instead of the domain administrator
meta := zms.DomainMeta{
BusinessService: businessService,
}
// if the operation fails, we're going to return the original error
if cli.Zms.PutDomainSystemMeta(zms.DomainName(dn), "businessservice", cli.AuditRef, &meta) != nil {
return nil, err
}
}
s := "[domain " + dn + " business-service successfully updated]\n"
message := SuccessMessage{
Expand Down

0 comments on commit be08d26

Please sign in to comment.