[BUGFIX] FilesReplacePermissionUpdate wrong where clause