mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-26 10:38:00 +01:00
24 lines
449 B
JavaScript
24 lines
449 B
JavaScript
(function() {
|
|
|
|
'use strict';
|
|
|
|
angular
|
|
.module('harbor.services.user')
|
|
.factory('ToggleAdminService', ToggleAdminService);
|
|
|
|
ToggleAdminService.$inject = ['$http'];
|
|
|
|
function ToggleAdminService($http) {
|
|
|
|
return toggleAdmin;
|
|
|
|
function toggleAdmin(userId, enabled) {
|
|
return $http
|
|
.put('/api/users/' + userId + '/sysadmin', {
|
|
'has_admin_role' : enabled
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
})(); |