X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fframework%2Fcore%2Fmodules%2Fapi%2FprojectManagementAPI.js;h=07e873d23373e7bf60542d13bd750927acfa4930;hp=3238aec915a8212da106f4ee6019954c254b5612;hb=bb11c05914869028a39a685cf5bf2ec347f299a1;hpb=cd4119f7fd2ee97de0b2b5307c6de11e8e600acd diff --git a/skyquake/framework/core/modules/api/projectManagementAPI.js b/skyquake/framework/core/modules/api/projectManagementAPI.js index 3238aec91..07e873d23 100644 --- a/skyquake/framework/core/modules/api/projectManagementAPI.js +++ b/skyquake/framework/core/modules/api/projectManagementAPI.js @@ -178,14 +178,18 @@ ProjectManagement.delete = function(req) { } -ProjectManagement.getPlatform = function(req) { +ProjectManagement.getPlatform = function(req, userId) { var self = this; var api_server = req.query['api_server']; - + var user = req.params['userId'] || userId; return new Promise(function(resolve, reject) { + var url = utils.confdPort(api_server) + '/api/operational/rbac-platform-config'; + if(user) { + url = url + '/user/' + user; + } Promise.all([ rp({ - uri: utils.confdPort(api_server) + '/api/operational/rbac-platform-config', + uri: url, method: 'GET', headers: _.extend({}, constants.HTTP_HEADERS.accept.data, { 'Authorization': req.session && req.session.authorization @@ -198,7 +202,11 @@ ProjectManagement.getPlatform = function(req) { var response = {}; response['data'] = {}; if (result[0].body) { - response['data']['platform'] = JSON.parse(result[0].body)['rw-rbac-platform:rbac-platform-config']; + if(user) { + response['data']['platform'] = JSON.parse(result[0].body)['rw-rbac-platform:user']; + } else { + response['data']['platform'] = JSON.parse(result[0].body)['rw-rbac-platform:rbac-platform-config']; + } } response.statusCode = constants.HTTP_RESPONSE_CODES.SUCCESS.OK