List <StandardActionType> GetAllowedStandardActionForRepository(PermissionEP permission, List <StandardActionType> actions, long idItem, int idUser, int IdCommunity) { lm.Comol.Core.FileRepository.Domain.ModuleRepository moduleRepository = GetCoreModuleRepository(idUser, IdCommunity); lm.Comol.Core.FileRepository.Domain.liteRepositoryItem item = Manager.Get <lm.Comol.Core.FileRepository.Domain.liteRepositoryItem>(idItem); if (item != null) { Boolean isPlayFile = (item.Type == Core.FileRepository.Domain.ItemType.ScormPackage || item.Type == Core.FileRepository.Domain.ItemType.Multimedia || item.Type == Core.FileRepository.Domain.ItemType.VideoStreaming); if (!item.IsInternal) { if (isPlayFile && moduleRepository.Administration || moduleRepository.ManageItems || moduleRepository.EditOthersFiles || (moduleRepository.UploadFile && item.IdOwner == idUser)) { actions.Add(StandardActionType.EditMetadata); } else if (moduleRepository.Administration || moduleRepository.ManageItems || moduleRepository.EditOthersFiles || (moduleRepository.UploadFile && item.IdOwner == idUser)) { actions.Remove(StandardActionType.ViewAdvancedStatistics); actions.Remove(StandardActionType.ViewUserStatistics); actions.Remove(StandardActionType.ViewPersonalStatistics); } } else if (isPlayFile && (permission.Create || permission.Update)) { actions.Add(StandardActionType.EditMetadata); } } return(actions.Distinct().ToList()); }
public static String PlayForRepository(lm.Comol.Core.FileRepository.Domain.liteRepositoryItem item, Boolean?setPrevious = null, String backUrl = "") { if (setPrevious == null) { setPrevious = !(item.DisplayMode == DisplayMode.downloadOrPlayOrModal || item.DisplayMode == DisplayMode.inModal); } if (!setPrevious.Value) { backUrl = ""; } return(FullPlay(item.Id, item.UniqueId, item.IdVersion, item.UniqueIdVersion, item.Type, 0, "", false, false, (item.DisplayMode == DisplayMode.downloadOrPlayOrModal || item.DisplayMode == DisplayMode.inModal), false, setPrevious.Value, backUrl)); }