KEYCLOAK-2490

This commit is contained in:
Bill Burke committed 2016-03-30 15:42:05 -04:00
1 parent 52617e6ef1
commit bfbbd5375f
1 file changed
+21 -4
@@ -1830,11 +1830,28 @@ module.controller('AuthenticationFlowsCtrl', function($scope, $route, realm, flo
$scope.removeFlow = function() {
console.log('Remove flow:' + $scope.flow.alias);
AuthenticationFlows.remove({realm: realm.realm, flow: $scope.flow.id}, function() {
$location.url("/realms/" + realm.realm + '/authentication/flows');
Notifications.success("Flow removed");
if (realm.browserFlow == $scope.flow.alias) {
Notifications.error("Cannot remove flow, it is currently being used as the browser flow.");
})
} else if (realm.registrationFlow == $scope.flow.alias) {
Notifications.error("Cannot remove flow, it is currently being used as the registration flow.");
} else if (realm.directGrantFlow == $scope.flow.alias) {
Notifications.error("Cannot remove flow, it is currently being used as the direct grant flow.");
} else if (realm.resetCredentialsFlow == $scope.flow.alias) {
Notifications.error("Cannot remove flow, it is currently being used as the reset credentials flow.");
} else if (realm.clientAuthenticationFlow == $scope.flow.alias) {
Notifications.error("Cannot remove flow, it is currently being used as the client authentication flow.");
} else {
AuthenticationFlows.remove({realm: realm.realm, flow: $scope.flow.id}, function () {
$location.url("/realms/" + realm.realm + '/authentication/flows');
Notifications.success("Flow removed");
})
}
};