From 465ba5c2ff1f158b462482e70bcd3189c272b2a8 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 15 Jun 2018 12:44:25 +0200 Subject: [PATCH] devTeam Dependencies need READ permissions to storage. Done. --- AABrowserAPI/UserAuthentication.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/AABrowserAPI/UserAuthentication.js b/AABrowserAPI/UserAuthentication.js index cf93785d3..b6fb0e12e 100644 --- a/AABrowserAPI/UserAuthentication.js +++ b/AABrowserAPI/UserAuthentication.js @@ -67,6 +67,18 @@ userProfile.storagePermissions.push([devTeam.codeName + "." + "READ", readPermission]); userProfile.storagePermissions.push([devTeam.codeName + "." + "WRITE", writePermission]); + /* Each devTeam potentially depends on data from other devTeams. The user will need the storage permissions to read that data. */ + + for (j = 0; j < devTeam.devTeamDependencies.length; j++) { + + let dependecy = devTeam.devTeamDependencies[j]; + + let container = dependecy.toLowerCase(); + + let readPermission = storageAccessManager.getPermission(container, "READ", MAX_STORAGE_PERMISSION_DAYS); + + userProfile.storagePermissions.push([dependecy + "." + "READ", readPermission]); + } } /* In order to be able to download a bot source code, the user will need READ permissions over the Platform container. */