mirror of
https://github.com/bitwarden/web
synced 2025-12-14 07:13:23 +00:00
organization listing from side menu
This commit is contained in:
@@ -4,14 +4,28 @@ angular
|
||||
.controller('sideNavController', function ($scope, $state, authService) {
|
||||
$scope.$state = $state;
|
||||
$scope.params = $state.params;
|
||||
$scope.orgs = [];
|
||||
|
||||
if ($state.includes('backend.org')) {
|
||||
authService.getUserProfile().then(function (userProfile) {
|
||||
if (!userProfile.organizations || !($state.params.orgId in userProfile.organizations)) {
|
||||
return;
|
||||
}
|
||||
authService.getUserProfile().then(function (userProfile) {
|
||||
if (!userProfile.organizations) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($state.includes('backend.org') && ($state.params.orgId in userProfile.organizations)) {
|
||||
$scope.orgProfile = userProfile.organizations[$state.params.orgId];
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
var orgs = [];
|
||||
for (var orgId in userProfile.organizations) {
|
||||
if (userProfile.organizations.hasOwnProperty(orgId)) {
|
||||
orgs.push(userProfile.organizations[orgId]);
|
||||
}
|
||||
}
|
||||
$scope.orgs = orgs;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.viewOrganization = function (id) {
|
||||
$state.go('backend.org.dashboard', { orgId: id });
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user