GUACAMOLE-220: Add missing getUserGroupAttributes() to JavaScript schemaService.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/615f5c6b Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/615f5c6b Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/615f5c6b Branch: refs/heads/staging/1.0.0 Commit: 615f5c6bab28f78884cf42fb29c76ad44822a33d Parents: 55bcf25 Author: Michael Jumper <mjum...@apache.org> Authored: Thu Apr 19 23:21:17 2018 -0700 Committer: Michael Jumper <mjum...@apache.org> Committed: Wed Aug 8 09:00:06 2018 -0700 ---------------------------------------------------------------------- .../webapp/app/rest/services/schemaService.js | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/615f5c6b/guacamole/src/main/webapp/app/rest/services/schemaService.js ---------------------------------------------------------------------- diff --git a/guacamole/src/main/webapp/app/rest/services/schemaService.js b/guacamole/src/main/webapp/app/rest/services/schemaService.js index cc871d8..61c8639 100644 --- a/guacamole/src/main/webapp/app/rest/services/schemaService.js +++ b/guacamole/src/main/webapp/app/rest/services/schemaService.js @@ -66,6 +66,40 @@ angular.module('rest').factory('schemaService', ['$injector', /** * Makes a request to the REST API to get the list of available attributes + * for user group objects, returning a promise that provides an array of + * @link{Form} objects if successful. Each element of the array describes + * a logical grouping of possible attributes. + * + * @param {String} dataSource + * The unique identifier of the data source containing the user groups + * whose available attributes are to be retrieved. This identifier + * corresponds to an AuthenticationProvider within the Guacamole web + * application. + * + * @returns {Promise.<Form[]>} + * A promise which will resolve with an array of @link{Form} + * objects, where each @link{Form} describes a logical grouping of + * possible attributes. + */ + service.getUserGroupAttributes = function getUserGroupAttributes(dataSource) { + + // Build HTTP parameters set + var httpParameters = { + token : authenticationService.getCurrentToken() + }; + + // Retrieve available user group attributes + return requestService({ + cache : cacheService.schema, + method : 'GET', + url : 'api/session/data/' + encodeURIComponent(dataSource) + '/schema/userGroupAttributes', + params : httpParameters + }); + + }; + + /** + * Makes a request to the REST API to get the list of available attributes * for connection objects, returning a promise that provides an array of * @link{Form} objects if successful. Each element of the array describes * a logical grouping of possible attributes.