parent
d54a11ad11
commit
d11f254476
@ -37,7 +37,20 @@ angular.module('lemur')
|
||||
.controller('AuthorityCreateController', function ($scope, $uibModalInstance, AuthorityService, AuthorityApi, LemurRestangular, RoleService, PluginService, WizardHandler, toaster) {
|
||||
$scope.authority = LemurRestangular.restangularizeElement(null, {}, 'authorities');
|
||||
// set the defaults
|
||||
AuthorityService.getDefaults($scope.authority);
|
||||
AuthorityService.getDefaults($scope.authority).then(function () {
|
||||
PluginService.getByType('issuer').then(function (plugins) {
|
||||
$scope.plugins = plugins;
|
||||
if ($scope.authority.defaultIssuerPlugin) {
|
||||
plugins.forEach(function(plugin) {
|
||||
if (plugin.slug === $scope.authority.defaultIssuerPlugin) {
|
||||
$scope.authority.plugin = plugin;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$scope.authority.plugin = plugins[0];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$scope.getAuthoritiesByName = function (value) {
|
||||
return AuthorityService.findAuthorityByName(value).then(function (authorities) {
|
||||
@ -71,19 +84,6 @@ angular.module('lemur')
|
||||
});
|
||||
};
|
||||
|
||||
PluginService.getByType('issuer').then(function (plugins) {
|
||||
$scope.plugins = plugins;
|
||||
if ($scope.authority.defaultIssuerPlugin) {
|
||||
plugins.forEach(function(plugin) {
|
||||
if (plugin.slug === $scope.authority.defaultIssuerPlugin) {
|
||||
$scope.authority.plugin = plugin;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$scope.authority.plugin = plugins[0];
|
||||
}
|
||||
});
|
||||
|
||||
$scope.roleService = RoleService;
|
||||
$scope.authorityService = AuthorityService;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user