mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-08 19:50:05 +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
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
})(); |