Skip to content

Commit

Permalink
Now all visuals visible across the application
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinyanakiev committed May 5, 2023
1 parent 8d05310 commit c83b661
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/domain/storage/document/dto/document.dto.create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ export class CreateDocumentInput {
size!: number;

externalID!: string;

anonymousReadAccess!: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export class StorageBucketResolverMutations {
agentInfo.userID
);

visualDocument.anonymousReadAccess = true;
// Ensure authorization is updated
await this.documentAuthorizationService.applyAuthorizationPolicy(
visualDocument,
Expand Down
7 changes: 5 additions & 2 deletions src/domain/storage/storage-bucket/storage.bucket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export class StorageBucketService {
buffer: Buffer,
filename: string,
mimeType: string,
userID: string
userID: string,
anonymousReadAccess = false
): Promise<IDocument> {
const storage = await this.getStorageBucketOrFail(storageBucket.id, {
relations: ['documents'],
Expand Down Expand Up @@ -173,6 +174,7 @@ export class StorageBucketService {
displayName: filename,
size: size,
createdBy: userID,
anonymousReadAccess,
};
const document = await this.documentService.createDocument(
createDocumentInput
Expand Down Expand Up @@ -216,7 +218,8 @@ export class StorageBucketService {
buffer,
fileName,
mimetype,
userID
userID,
true
);
return document;
} catch (error: any) {
Expand Down

0 comments on commit c83b661

Please sign in to comment.