2017-06-20 11:00:32 +00:00
|
|
|
angular.module('registryAccess', [])
|
2017-09-21 14:00:53 +00:00
|
|
|
.controller('RegistryAccessController', ['$scope', '$transition$', 'RegistryService', 'Notifications',
|
|
|
|
function ($scope, $transition$, RegistryService, Notifications) {
|
2017-06-20 11:00:32 +00:00
|
|
|
|
|
|
|
$scope.updateAccess = function(authorizedUsers, authorizedTeams) {
|
2017-09-21 14:00:53 +00:00
|
|
|
return RegistryService.updateAccess($transition$.params().id, authorizedUsers, authorizedTeams);
|
2017-06-20 11:00:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
function initView() {
|
|
|
|
$('#loadingViewSpinner').show();
|
2017-09-21 14:00:53 +00:00
|
|
|
RegistryService.registry($transition$.params().id)
|
2017-06-20 11:00:32 +00:00
|
|
|
.then(function success(data) {
|
|
|
|
$scope.registry = data;
|
|
|
|
})
|
|
|
|
.catch(function error(err) {
|
|
|
|
Notifications.error('Failure', err, 'Unable to retrieve registry details');
|
|
|
|
})
|
|
|
|
.finally(function final(){
|
|
|
|
$('#loadingViewSpinner').hide();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
initView();
|
|
|
|
}]);
|