1
0
mirror of https://github.com/bitwarden/web synced 2025-12-23 19:53: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

@@ -24,15 +24,20 @@
return authService.getUserProfile();
}).then(function (profile) {
if (profile && profile.organizations) {
var orgs = [];
for (var i = 0; i < profile.organizations.length; i++) {
orgs.push({
id: profile.organizations[i].id,
name: profile.organizations[i].name
});
var orgs = [],
setFirstOrg = false;
if (i === 0) {
$scope.model.organizationId = profile.organizations[i].id;
for (var i in profile.organizations) {
if (profile.organizations.hasOwnProperty(i)) {
orgs.push({
id: profile.organizations[i].id,
name: profile.organizations[i].name
});
if (!setFirstOrg) {
setFirstOrg = true;
$scope.model.organizationId = profile.organizations[i].id;
}
}
}