Files: added virtual rooms default share

This commit is contained in:
Maksim Chegulov 2022-06-10 22:31:24 +03:00
parent 2811e694c6
commit d370c797bb

View File

@ -305,6 +305,32 @@ public class FileSecurity : IFileSecurity
// TODO: For Projects and other
defaultShareRecord = null;
break;
case FolderType.VirtualRooms:
defaultShareRecord = new FileShareRecord
{
Level = int.MaxValue,
EntryId = entry.Id,
EntryType = entry.FileEntryType,
Share = FileShare.Read,
Subject = Constants.GroupAdmin.ID,
TenantId = _tenantManager.GetCurrentTenant().Id,
Owner = entry.RootCreateBy
};
if (!shares.Any())
{
if ((defaultShareRecord.Share == FileShare.Read && action == FilesSecurityActions.Read) ||
(defaultShareRecord.Share == FileShare.ReadWrite))
{
return _userManager.GetUsersByGroup(defaultShareRecord.Subject)
.Where(x => x.Status == EmployeeStatus.Active).Select(y => y.Id).Distinct();
}
return Enumerable.Empty<Guid>();
}
break;
default:
defaultShareRecord = null;