remove permission for domain failover
@@ -387,9 +387,12 @@ func (wh *WorkflowHandler) UpdateDomain(ctx context.Context,
return nil, wh.error(errRequestNotSet, scope)
}
+ // don't require permission for failover request
+ if !isFailoverRequest(updateRequest) {
if err := wh.checkPermission(updateRequest.SecurityToken, scope); err != nil {
return nil, err
}
+ }
clusterMetadata := wh.GetClusterMetadata()
// TODO remove the IsGlobalDomainEnabled check once cross DC is public
@@ -2606,6 +2609,10 @@ func createServiceBusyError() *gen.ServiceBusyError {
return err
}
+func isFailoverRequest(updateRequest *gen.UpdateDomainRequest) bool {
+ return updateRequest.ReplicationConfiguration != nil && updateRequest.ReplicationConfiguration.ActiveClusterName != nil
+}
+
func (wh *WorkflowHandler) validateClusterName(clusterName string) error {
clusterMetadata := wh.GetClusterMetadata()
if _, ok := clusterMetadata.GetAllClusterFailoverVersions()[clusterName]; !ok {
