From 16fb2d3b707b9dd1e527992866a53b4c89fc1e4d Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Sun, 28 Jul 2013 08:57:17 -0400 Subject: [PATCH] AC-290 Non-privy users can now see the local_path value for the project. The base path shows as 'You do not have access to view this property'. So the user knows a project path is set, they just don't know the full path. --- awx/ui/static/js/controllers/Projects.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/awx/ui/static/js/controllers/Projects.js b/awx/ui/static/js/controllers/Projects.js index 4aaeceadb0..5045d415db 100644 --- a/awx/ui/static/js/controllers/Projects.js +++ b/awx/ui/static/js/controllers/Projects.js @@ -127,7 +127,8 @@ ProjectsAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, - RelatedPaginateInit, Prompt, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath) + RelatedPaginateInit, Prompt, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, + Authorization) { ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior //scope. @@ -155,7 +156,15 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara for (var set in relatedSets) { scope.search(relatedSets[set].iterator); } - GetProjectPath({ scope: scope, master: master }); + if (Authorization.getUserInfo('is_superuser') == true) { + GetProjectPath({ scope: scope, master: master }); + } + else { + var opts = []; + opts.push(scope['local_path']); + scope.project_local_paths = opts; + scope.base_dir = 'You do not have access to view this property'; + } }); // Retrieve detail record and prepopulate the form @@ -253,5 +262,5 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara ProjectsEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'ProjectsForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'ClearScope', 'GetBasePath', 'ReturnToCaller', - 'GetProjectPath' + 'GetProjectPath', 'Authorization' ];