mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-22 17:03:08 +02:00
prevent a "always nsfw" user from unmarking their media
This commit is contained in:
parent
da8b248898
commit
a7d19d0c36
1 changed files with 2 additions and 1 deletions
|
@ -632,7 +632,8 @@ export class DriveService {
|
|||
|
||||
@bindThis
|
||||
public async updateFile(file: MiDriveFile, values: Partial<MiDriveFile>, updater: MiUser) {
|
||||
const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw;
|
||||
const profile = await this.userProfilesRepository.findOneBy({ userId: file.userId });
|
||||
const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw || (profile !== null && profile!.alwaysMarkNsfw);
|
||||
|
||||
if (values.name != null && !this.driveFileEntityService.validateFileName(values.name)) {
|
||||
throw new DriveService.InvalidFileNameError();
|
||||
|
|
Loading…
Reference in a new issue