Add flag to always allow share by link

This commit is contained in:
lethemanh
2025-05-16 20:19:20 +07:00
parent 7595a6d856
commit d831ffc5fe
6 changed files with 10 additions and 7 deletions
@@ -550,7 +550,7 @@ export class DocumentsService {
*/
update = async (
id: string,
content: Partial<DriveFile>,
content: Partial<DriveFile> & { is_update_access_to_share_link?: boolean },
context: CompanyExecutionContext,
): Promise<DriveFile> => {
if (!context) {
@@ -614,7 +614,7 @@ export class DocumentsService {
}
if (key === "access_info") {
// if manage access is disabled, we don't allow changing access level
if (!this.manageAccessEnabled) {
if (!this.manageAccessEnabled && !content.is_update_access_to_share_link) {
delete content.access_info;
} else if (content.access_info) {
const sharedWith = content.access_info.entities.filter(
@@ -257,7 +257,7 @@ export class DocumentsController {
update = async (
request: FastifyRequest<{
Params: ItemRequestParams;
Body: Partial<DriveFile>;
Body: Partial<DriveFile> & { is_update_access_to_share_link?: boolean };
Querystring: { public_token?: string };
}>,
): Promise<DriveFile> => {