mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 11:43:46 +00:00
[feature] Implement scope warning for exports (#688)
* [feature] Add a hasOrganizations() service method * [feature] Add a component to warn users about export scope
This commit is contained in:
@@ -7,4 +7,5 @@ export abstract class OrganizationService {
|
||||
getAll: (userId?: string) => Promise<Organization[]>;
|
||||
save: (orgs: { [id: string]: OrganizationData }) => Promise<any>;
|
||||
canManageSponsorships: () => Promise<boolean>;
|
||||
hasOrganizations: (userId?: string) => Promise<boolean>;
|
||||
}
|
||||
|
||||
@@ -47,4 +47,9 @@ export class OrganizationService implements OrganizationServiceAbstraction {
|
||||
(o) => o.familySponsorshipAvailable || o.familySponsorshipFriendlyName !== null
|
||||
);
|
||||
}
|
||||
|
||||
async hasOrganizations(userId?: string): Promise<boolean> {
|
||||
const organizations = await this.getAll(userId);
|
||||
return organizations.length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user