mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
user canAccessPremium checks
This commit is contained in:
@@ -116,6 +116,21 @@ export class UserService implements UserServiceAbstraction {
|
||||
return userId != null;
|
||||
}
|
||||
|
||||
async canAccessPremium(): Promise<boolean> {
|
||||
const tokenPremium = await this.tokenService.getPremium();
|
||||
if (tokenPremium) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const orgs = await this.getAllOrganizations();
|
||||
for (let i = 0; i < orgs.length; i++) {
|
||||
if (orgs[i].usersGetPremium) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async getOrganization(id: string): Promise<Organization> {
|
||||
const userId = await this.getUserId();
|
||||
const organizations = await this.storageService.get<{ [id: string]: OrganizationData; }>(
|
||||
|
||||
Reference in New Issue
Block a user