mirror of
https://github.com/bitwarden/web
synced 2026-01-04 17:43:47 +00:00
org disabled and license expired warnings
This commit is contained in:
@@ -5,11 +5,15 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
|
||||
@Injectable()
|
||||
export class OrganizationGuardService implements CanActivate {
|
||||
constructor(private userService: UserService, private router: Router) { }
|
||||
constructor(private userService: UserService, private router: Router,
|
||||
private toasterService: ToasterService, private i18nService: I18nService) { }
|
||||
|
||||
async canActivate(route: ActivatedRouteSnapshot) {
|
||||
const org = await this.userService.getOrganization(route.params.organizationId);
|
||||
@@ -17,6 +21,11 @@ export class OrganizationGuardService implements CanActivate {
|
||||
this.router.navigate(['/']);
|
||||
return false;
|
||||
}
|
||||
if (!org.isOwner && !org.enabled) {
|
||||
this.toasterService.popAsync('error', null, this.i18nService.t('organizationIsDisabled'));
|
||||
this.router.navigate(['/']);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user