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.orgname = $routeParams['orgname'];
|
||||||
$scope.username = $routeParams['username'];
|
$scope.username = $routeParams['username'];
|
||||||
|
|
||||||
|
@ -32,8 +32,11 @@
|
||||||
$scope.organization = org;
|
$scope.organization = org;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$scope.entityResource = ApiService.getUserInformationAsResource({'username': $scope.username}).get(function(user) {
|
UserService.updateUserIn($scope, function(currentUser) {
|
||||||
$scope.viewuser = user;
|
$scope.entityResource = ApiService.getUserInformationAsResource({'username': $scope.username}).get(function(user) {
|
||||||
|
$scope.invaliduser = !currentUser || currentUser.username != $scope.username;
|
||||||
|
$scope.viewuser = user;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,8 +25,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="co-main-content-panel" style="min-height: 500px;">
|
<div class="co-main-content-panel" style="min-height: 500px;">
|
||||||
<div class="plan-manager" organization="organization.name" has-subscription="hasSubscription" ng-if="organization"></div>
|
<div ng-if="!invaliduser">
|
||||||
<div class="plan-manager" user="viewuser" has-subscription="hasSubscription" ng-if="!organization"></div>
|
<div class="plan-manager" organization="organization.name" has-subscription="hasSubscription" ng-if="organization"></div>
|
||||||
|
<div class="plan-manager" user="viewuser" has-subscription="hasSubscription" ng-if="!organization"></div>
|
||||||
|
</div>
|
||||||
|
<div class="co-alert co-alert-danger" ng-if="invaliduser">
|
||||||
|
You do not have access to this resource
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -25,8 +25,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="co-main-content-panel" style="min-height: 500px;">
|
<div class="co-main-content-panel" style="min-height: 500px;">
|
||||||
<div class="billing-invoices" user="viewuser" makevisible="true" ng-if="!organization"></div>
|
<div ng-if="!invaliduser">
|
||||||
<div class="billing-invoices" organization="organization" makevisible="true" ng-if="organization"></div>
|
<div class="billing-invoices" user="viewuser" makevisible="true" ng-if="!organization"></div>
|
||||||
|
<div class="billing-invoices" organization="organization" makevisible="true" ng-if="organization"></div>
|
||||||
|
</div>
|
||||||
|
<div class="co-alert co-alert-danger" ng-if="invaliduser">
|
||||||
|
You do not have access to this resource
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
Reference in a new issue