🐛 Fix missing file permission creation

This commit is contained in:
2026-01-12 19:32:50 +08:00
parent 7085f43e54
commit c11bf579c4
12 changed files with 158 additions and 3 deletions

View File

@@ -374,6 +374,8 @@ public class PublisherController(
"Invalid picture id, unable to find the file on cloud."
);
picture = SnCloudFileReferenceObject.FromProtoValue(queryResult);
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.PictureId });
}
if (request.BackgroundId is not null)
@@ -386,6 +388,8 @@ public class PublisherController(
"Invalid background id, unable to find the file on cloud."
);
background = SnCloudFileReferenceObject.FromProtoValue(queryResult);
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.BackgroundId });
}
var publisher = await ps.CreateIndividualPublisher(
@@ -471,6 +475,8 @@ public class PublisherController(
"Invalid picture id, unable to find the file on cloud."
);
picture = SnCloudFileReferenceObject.FromProtoValue(queryResult);
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.PictureId });
}
if (request.BackgroundId is not null)
@@ -483,6 +489,8 @@ public class PublisherController(
"Invalid background id, unable to find the file on cloud."
);
background = SnCloudFileReferenceObject.FromProtoValue(queryResult);
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.BackgroundId });
}
var publisher = await ps.CreateOrganizationPublisher(
@@ -569,6 +577,8 @@ public class PublisherController(
var picture = SnCloudFileReferenceObject.FromProtoValue(queryResult);
publisher.Picture = picture;
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.PictureId });
}
if (request.BackgroundId is not null)
@@ -583,6 +593,8 @@ public class PublisherController(
var background = SnCloudFileReferenceObject.FromProtoValue(queryResult);
publisher.Background = background;
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.BackgroundId });
}
db.Update(publisher);