GUAC-1126 Created user page service which provides the list of main pages for a user.

This commit is contained in:
James Muehlner
2015-04-01 23:21:31 -07:00
committed by Michael Jumper
parent 1d0b32388b
commit 7bf4cb83d8
11 changed files with 314 additions and 210 deletions

View File

@@ -30,9 +30,11 @@ angular.module('home').controller('homeController', ['$scope', '$injector',
var ConnectionGroup = $injector.get("ConnectionGroup");
// Get required services
var $location = $injector.get("$location");
var authenticationService = $injector.get("authenticationService");
var connectionGroupService = $injector.get("connectionGroupService");
var permissionService = $injector.get("permissionService");
var userPageService = $injector.get("userPageService");
/**
* The root connection group, or null if the connection group hierarchy has
@@ -67,7 +69,13 @@ angular.module('home').controller('homeController', ['$scope', '$injector',
// Retrieve root group and all descendants
connectionGroupService.getConnectionGroupTree(ConnectionGroup.ROOT_IDENTIFIER)
.success(function rootGroupRetrieved(rootConnectionGroup) {
$scope.rootConnectionGroup = rootConnectionGroup;
// Navigate to home page, if not already there
var homePage = userPageService.getHomePage(rootConnectionGroup);
$location.url(homePage.url);
});
// Retrieve current permissions