Show an error when trying to view a billing page not your own

Fixes #1443
This commit is contained in:
Joseph Schorr 2016-05-13 15:06:53 -04:00
parent 23e925b259
commit 1f13015ad3
3 changed files with 20 additions and 7 deletions

View file

@ -22,7 +22,7 @@
}]);
function BillingCtrl($scope, ApiService, $routeParams) {
function BillingCtrl($scope, ApiService, $routeParams, UserService) {
$scope.orgname = $routeParams['orgname'];
$scope.username = $routeParams['username'];
@ -32,8 +32,11 @@
$scope.organization = org;
});
} else {
$scope.entityResource = ApiService.getUserInformationAsResource({'username': $scope.username}).get(function(user) {
$scope.viewuser = user;
UserService.updateUserIn($scope, function(currentUser) {
$scope.entityResource = ApiService.getUserInformationAsResource({'username': $scope.username}).get(function(user) {
$scope.invaliduser = !currentUser || currentUser.username != $scope.username;
$scope.viewuser = user;
});
});
}
};