2017-01-31 23:26:29 +00:00
|
|
|
angular.module('portainer.rest')
|
2017-07-20 14:22:27 +00:00
|
|
|
.factory('Users', ['$resource', 'API_ENDPOINT_USERS', function UsersFactory($resource, API_ENDPOINT_USERS) {
|
2017-01-31 23:26:29 +00:00
|
|
|
'use strict';
|
2017-07-20 14:22:27 +00:00
|
|
|
return $resource(API_ENDPOINT_USERS + '/:id/:entity/:entityId', {}, {
|
2017-01-31 23:26:29 +00:00
|
|
|
create: { method: 'POST' },
|
2017-03-12 16:24:15 +00:00
|
|
|
query: { method: 'GET', isArray: true },
|
|
|
|
get: { method: 'GET', params: { id: '@id' } },
|
|
|
|
update: { method: 'PUT', params: { id: '@id' } },
|
|
|
|
remove: { method: 'DELETE', params: { id: '@id'} },
|
2017-05-23 18:56:10 +00:00
|
|
|
queryMemberships: { method: 'GET', isArray: true, params: { id: '@id', entity: 'memberships' } },
|
|
|
|
queryTeams: { method: 'GET', isArray: true, params: { id: '@id', entity: 'teams' } },
|
2017-03-12 16:24:15 +00:00
|
|
|
// RPCs should be moved to a specific endpoint
|
2017-05-23 18:56:10 +00:00
|
|
|
checkPassword: { method: 'POST', params: { id: '@id', entity: 'passwd' } },
|
|
|
|
checkAdminUser: { method: 'GET', params: { id: 'admin', entity: 'check' }, isArray: true },
|
|
|
|
initAdminUser: { method: 'POST', params: { id: 'admin', entity: 'init' } }
|
2017-01-31 23:26:29 +00:00
|
|
|
});
|
|
|
|
}]);
|