1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

attachments accessible if can access premium

This commit is contained in:
Kyle Spearrin
2018-08-29 09:22:24 -04:00
parent 3fa63ee2c2
commit cfe3d9ae5f
4 changed files with 12 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ import * as path from 'path';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { CryptoService } from 'jslib/abstractions/crypto.service';
import { FolderService } from 'jslib/abstractions/folder.service';
import { TokenService } from 'jslib/abstractions/token.service';
import { UserService } from 'jslib/abstractions/user.service';
import { Response } from '../models/response';
import { CipherResponse } from '../models/response/cipherResponse';
@@ -18,7 +18,7 @@ import { CliUtils } from '../utils';
export class CreateCommand {
constructor(private cipherService: CipherService, private folderService: FolderService,
private tokenService: TokenService, private cryptoService: CryptoService) { }
private userService: UserService, private cryptoService: CryptoService) { }
async run(object: string, requestJson: string, cmd: program.Command): Promise<Response> {
let req: any = null;
@@ -82,8 +82,8 @@ export class CreateCommand {
return Response.notFound();
}
if (cipher.organizationId == null && !this.tokenService.getPremium()) {
return Response.error('A premium membership is required to use this feature.');
if (cipher.organizationId == null && !(await this.userService.canAccessPremium())) {
return Response.error('Premium status is required to use this feature.');
}
const encKey = await this.cryptoService.getEncKey();