Show an error when trying to view a billing page not your own
Fixes #1443
This commit is contained in:
parent
23e925b259
commit
1f13015ad3
3 changed files with 20 additions and 7 deletions
|
@ -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;
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Reference in a new issue