1
0
mirror of https://github.com/bitwarden/web synced 2025-12-16 08:13:22 +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

@@ -93,15 +93,15 @@ angular
};
if (profile.Organizations) {
var orgs = [];
var orgs = {};
for (var i = 0; i < profile.Organizations.length; i++) {
orgs.push({
orgs[profile.Organizations[i].Id] = {
id: profile.Organizations[i].Id,
name: profile.Organizations[i].Name,
key: profile.Organizations[i].Key,
status: profile.Organizations[i].Status,
type: profile.Organizations[i].Type
});
};
}
_userProfile.organizations = orgs;
@@ -118,8 +118,8 @@ angular
_service.addProfileOrganization = function (org) {
return _service.getUserProfile().then(function (profile) {
if (profile) {
if (!profile.Organizations) {
profile.Organizations = [];
if (!profile.organizations) {
profile.organizations = {};
}
var o = {
@@ -129,7 +129,7 @@ angular
status: 2, // 2 = Confirmed
type: 0 // 0 = Owner
};
profile.organizations.push(o);
profile.organizations[o.id] = o;
_userProfile = profile;
cryptoService.addOrgKey(o.id, o.key);