
webapp.scripts.components.auth.security.service.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of centraldogma-server Show documentation
Show all versions of centraldogma-server Show documentation
Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2 (centraldogma-server)
'use strict';
angular.module('CentralDogmaAdmin')
.factory('Security',
function ($rootScope, $http, $q, NotificationUtil) {
return {
resolve: function () {
var defer = $q.defer();
if (this.isResolved()) {
defer.resolve($rootScope.isSecurityEnabled);
} else {
$http.get('/security_enabled').then(function () {
$rootScope.isSecurityEnabled = true;
defer.resolve(true);
}, function (error) {
if (error.status === 404) {
defer.resolve(false);
} else {
NotificationUtil.error(error);
defer.reject(error);
}
});
}
return defer.promise;
},
isResolved: function () {
return angular.isDefined($rootScope.isSecurityEnabled);
}
};
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy