1
0
mirror of https://github.com/bitwarden/web synced 2025-12-10 21:33:16 +00:00

access control on orgs pages

This commit is contained in:
Kyle Spearrin
2017-03-27 21:55:39 -04:00
parent 77ddc83a04
commit 35e0f27f52
5 changed files with 47 additions and 30 deletions

View File

@@ -7,16 +7,11 @@ angular
if ($state.includes('backend.org')) {
authService.getUserProfile().then(function (userProfile) {
if (!userProfile.organizations || !userProfile.organizations.length) {
if (!userProfile.organizations || !($state.params.orgId in userProfile.organizations)) {
return;
}
for (var i = 0; i < userProfile.organizations.length; i++) {
if (userProfile.organizations[i].id === $state.params.orgId) {
$scope.orgProfile = userProfile.organizations[i];
break;
}
}
$scope.orgProfile = userProfile.organizations[$state.params.orgId];
});
}
});