parent
d54a11ad11
commit
d11f254476
|
@ -37,7 +37,20 @@ angular.module('lemur')
|
||||||
.controller('AuthorityCreateController', function ($scope, $uibModalInstance, AuthorityService, AuthorityApi, LemurRestangular, RoleService, PluginService, WizardHandler, toaster) {
|
.controller('AuthorityCreateController', function ($scope, $uibModalInstance, AuthorityService, AuthorityApi, LemurRestangular, RoleService, PluginService, WizardHandler, toaster) {
|
||||||
$scope.authority = LemurRestangular.restangularizeElement(null, {}, 'authorities');
|
$scope.authority = LemurRestangular.restangularizeElement(null, {}, 'authorities');
|
||||||
// set the defaults
|
// 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) {
|
$scope.getAuthoritiesByName = function (value) {
|
||||||
return AuthorityService.findAuthorityByName(value).then(function (authorities) {
|
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.roleService = RoleService;
|
||||||
$scope.authorityService = AuthorityService;
|
$scope.authorityService = AuthorityService;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue