Merge branch 'develop' into bugfix/tfa

This commit is contained in:
Viktor Fomin 2022-07-13 21:09:12 +03:00 committed by GitHub
commit 389ae00068
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -131,7 +131,7 @@ internal class FileConverterService<T> : BackgroundService
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
if (!fileSecurity.CanReadAsync(file).Result && file.RootFolderType != FolderType.BUNCH)
if (!await fileSecurity.CanReadAsync(file) && file.RootFolderType != FolderType.BUNCH)
{
//No rights in CRM after upload before attach
throw new System.Security.SecurityException(FilesCommonResource.ErrorMassage_SecurityException_ReadFile);
@ -149,7 +149,7 @@ internal class FileConverterService<T> : BackgroundService
var docKey = documentServiceHelper.GetDocKey(file);
fileUri = documentServiceConnector.ReplaceCommunityAdress(fileUri);
(operationResultProgress, convertedFileUrl) = documentServiceConnector.GetConvertedUriAsync(fileUri, fileExtension, toExtension, docKey, password, CultureInfo.CurrentUICulture.Name, null, null, true).Result;
(operationResultProgress, convertedFileUrl) = await documentServiceConnector.GetConvertedUriAsync(fileUri, fileExtension, toExtension, docKey, password, CultureInfo.CurrentUICulture.Name, null, null, true);
}
catch (Exception exception)
{
@ -210,7 +210,7 @@ internal class FileConverterService<T> : BackgroundService
try
{
newFile = fileConverter.SaveConvertedFileAsync(file, convertedFileUrl).Result;
newFile = await fileConverter.SaveConvertedFileAsync(file, convertedFileUrl);
}
catch (Exception e)
{
@ -233,8 +233,8 @@ internal class FileConverterService<T> : BackgroundService
if (newFile != null)
{
var folderDao = daoFactory.GetFolderDao<T>();
var folder = folderDao.GetFolderAsync(newFile.ParentId).Result;
var folderTitle = fileSecurity.CanReadAsync(folder).Result ? folder.Title : null;
var folder = await folderDao.GetFolderAsync(newFile.ParentId);
var folderTitle = await fileSecurity.CanReadAsync(folder) ? folder.Title : null;
operationResult.Result = fileConverterQueue.FileJsonSerializerAsync(entryManager, newFile, folderTitle).Result;
}

View File

@ -202,7 +202,7 @@ public class UserController : PeopleControllerBase
[HttpPost]
[Authorize(AuthenticationSchemes = "confirm", Roles = "LinkInvite,Everyone")]
public EmployeeDto AddMember(MemberRequestDto inDto)
public async Task<EmployeeDto> AddMember(MemberRequestDto inDto)
{
_apiContext.AuthByClaim();
@ -226,7 +226,7 @@ public class UserController : PeopleControllerBase
if (success)
{
var folderDao = _daoFactory.GetFolderDao<int>();
var folder = folderDao.GetFolderAsync(id).Result;
var folder = await folderDao.GetFolderAsync(id);
if (folder == null)
{
@ -236,7 +236,7 @@ public class UserController : PeopleControllerBase
else
{
var folderDao = _daoFactory.GetFolderDao<string>();
var folder = folderDao.GetFolderAsync(inDto.RoomId).Result;
var folder = await folderDao.GetFolderAsync(inDto.RoomId);
if (folder == null)
{