1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

allow attachments if can access premium

This commit is contained in:
Kyle Spearrin
2018-08-29 09:21:27 -04:00
parent 81c21418ec
commit 42dbdb0043
2 changed files with 5 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ import { CipherService } from '../../abstractions/cipher.service';
import { CryptoService } from '../../abstractions/crypto.service';
import { I18nService } from '../../abstractions/i18n.service';
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
import { TokenService } from '../../abstractions/token.service';
import { UserService } from '../../abstractions/user.service';
import { Cipher } from '../../models/domain/cipher';
@@ -33,7 +33,7 @@ export class AttachmentsComponent implements OnInit {
constructor(protected cipherService: CipherService, protected analytics: Angulartics2,
protected toasterService: ToasterService, protected i18nService: I18nService,
protected cryptoService: CryptoService, protected tokenService: TokenService,
protected cryptoService: CryptoService, protected userService: UserService,
protected platformUtilsService: PlatformUtilsService, protected win: Window) { }
async ngOnInit() {
@@ -41,8 +41,8 @@ export class AttachmentsComponent implements OnInit {
this.cipher = await this.cipherDomain.decrypt();
this.hasUpdatedKey = await this.cryptoService.hasEncKey();
const isPremium = this.tokenService.getPremium();
this.canAccessAttachments = isPremium || this.cipher.organizationId != null;
const canAccessPremium = await this.userService.canAccessPremium();
this.canAccessAttachments = canAccessPremium || this.cipher.organizationId != null;
if (!this.canAccessAttachments) {
const confirmed = await this.platformUtilsService.showDialog(