|
|
@ -58,6 +58,14 @@ export class AttachmentsService { |
|
|
|
path?: string; |
|
|
|
path?: string; |
|
|
|
scope?: PublicAttachmentScope; |
|
|
|
scope?: PublicAttachmentScope; |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
|
|
|
|
// Validate scope if exist
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
param.scope && |
|
|
|
|
|
|
|
!Object.values(PublicAttachmentScope).includes(param.scope) |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
NcError.invalidAttachmentUploadScope(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const userId = param.req?.user.id || 'anonymous'; |
|
|
|
const userId = param.req?.user.id || 'anonymous'; |
|
|
|
|
|
|
|
|
|
|
|
param.path = param.scope |
|
|
|
param.path = param.scope |
|
|
@ -206,6 +214,14 @@ export class AttachmentsService { |
|
|
|
path?: string; |
|
|
|
path?: string; |
|
|
|
scope?: PublicAttachmentScope; |
|
|
|
scope?: PublicAttachmentScope; |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
|
|
|
|
// Validate scope if exist
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
param.scope && |
|
|
|
|
|
|
|
!Object.values(PublicAttachmentScope).includes(param.scope) |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
NcError.invalidAttachmentUploadScope(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const userId = param.req?.user.id || 'anonymous'; |
|
|
|
const userId = param.req?.user.id || 'anonymous'; |
|
|
|
|
|
|
|
|
|
|
|
param.path = param.scope |
|
|
|
param.path = param.scope |
|
|
|