diff --git a/products/ASC.Files/Core/Resources/FilesCommonResource.Designer.cs b/products/ASC.Files/Core/Resources/FilesCommonResource.Designer.cs index 4451f769f6..242f0acae4 100644 --- a/products/ASC.Files/Core/Resources/FilesCommonResource.Designer.cs +++ b/products/ASC.Files/Core/Resources/FilesCommonResource.Designer.cs @@ -842,6 +842,15 @@ namespace ASC.Files.Core.Resources { } } + /// + /// Looks up a localized string similar to You don't have enough permission to archive the room. + /// + public static string ErrorMessage_SecurityException_ArchiveRoom { + get { + return ResourceManager.GetString("ErrorMessage_SecurityException_ArchiveRoom", resourceCulture); + } + } + /// /// Looks up a localized string similar to You don't have permission to copy to this folder. /// @@ -870,11 +879,11 @@ namespace ASC.Files.Core.Resources { } /// - /// Looks up a localized string similar to You don't have enough permission to archive the room. + /// Looks up a localized string similar to You don't have enough permission to unarchive the room. /// - public static string ErrorMessage_UnarchiveRoom { + public static string ErrorMessage_SecurityException_UnarchiveRoom { get { - return ResourceManager.GetString("ErrorMessage_UnarchiveRoom", resourceCulture); + return ResourceManager.GetString("ErrorMessage_SecurityException_UnarchiveRoom", resourceCulture); } } diff --git a/products/ASC.Files/Core/Resources/FilesCommonResource.resx b/products/ASC.Files/Core/Resources/FilesCommonResource.resx index bdd092d114..9aba67cada 100644 --- a/products/ASC.Files/Core/Resources/FilesCommonResource.resx +++ b/products/ASC.Files/Core/Resources/FilesCommonResource.resx @@ -375,8 +375,8 @@ You don't have permission to move to this folder - - You don't have enough permission to archive the room + + You don't have enough permission to unarchive the room You cannot edit archived rooms @@ -472,4 +472,7 @@ Highest compatibility with docx, xlsx, pptx. Collaborator + + You don't have enough permission to archive the room + \ No newline at end of file diff --git a/products/ASC.Files/Core/Services/WCFService/FileOperations/FileMoveCopyOperation.cs b/products/ASC.Files/Core/Services/WCFService/FileOperations/FileMoveCopyOperation.cs index 67868c97f7..0c79f3878e 100644 --- a/products/ASC.Files/Core/Services/WCFService/FileOperations/FileMoveCopyOperation.cs +++ b/products/ASC.Files/Core/Services/WCFService/FileOperations/FileMoveCopyOperation.cs @@ -146,6 +146,7 @@ class FileMoveCopyOperation : FileOperation, T> if (0 < Folders.Count) { var firstFolder = await FolderDao.GetFolderAsync(Folders[0]); + var isRoom = DocSpaceHelper.IsRoom(firstFolder.FolderType); if (_copy && !await FilesSecurity.CanCopyAsync(firstFolder)) { @@ -155,7 +156,17 @@ class FileMoveCopyOperation : FileOperation, T> } if (!_copy && !await FilesSecurity.CanMoveAsync(firstFolder)) { - this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFile; + if (isRoom) + { + this[Err] = toFolder.FolderType == FolderType.Archive + ? FilesCommonResource.ErrorMessage_SecurityException_ArchiveRoom + : FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom; + + } + else + { + this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFolder; + } return; } @@ -187,7 +198,9 @@ class FileMoveCopyOperation : FileOperation, T> } if (!_copy && !await fileSecurity.CanMoveToAsync(toFolder)) { - this[Err] = FilesCommonResource.ErrorMessage_SecurityException_MoveToFolder; + this[Err] = toFolder.FolderType == FolderType.VirtualRooms ? FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom : + toFolder.FolderType == FolderType.Archive ? FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom : + FilesCommonResource.ErrorMessage_SecurityException_MoveToFolder; return; } @@ -270,7 +283,16 @@ class FileMoveCopyOperation : FileOperation, T> } else if (!copy && checkPermissions && !canMoveOrCopy) { - this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFolder; + if (isRoom) + { + this[Err] = toFolder.FolderType == FolderType.Archive + ? FilesCommonResource.ErrorMessage_SecurityException_ArchiveRoom + : FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom; + } + else + { + this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFolder; + } } else if (!isRoom && (toFolder.FolderType == FolderType.VirtualRooms || toFolder.RootFolderType == FolderType.Archive)) { @@ -278,7 +300,7 @@ class FileMoveCopyOperation : FileOperation, T> } else if (isRoom && toFolder.FolderType != FolderType.VirtualRooms && toFolder.FolderType != FolderType.Archive) { - this[Err] = FilesCommonResource.ErrorMessage_UnarchiveRoom; + this[Err] = FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom; } else if (!isRoom && folder.Private && !await CompliesPrivateRoomRulesAsync(folder, toFolderParents)) {