public AttachedFilesWithUploader( EntityFileManagerRegister entityFileManagers, IFileManager context, UserContext userContext) { this.entityFileManagers = entityFileManagers; this.context = context; this.userContext = userContext; }
public DocumentUploader( EntityFileManagerRegister entityFileManagers, IFileManager context, UserContext userContext) { this.entityFileManagers = entityFileManagers; this.context = context; this.userContext = userContext; }
/// <summary> /// Gets inline form for either <see cref="AttachedFilesWithUploader"/> or <see cref="AttachedFiles"/>, /// depending on whether the user has permissions to upload files. /// </summary> /// <typeparam name="TContext">Context to which the files are attached.</typeparam> /// <param name="entityFileManagers"></param> /// <param name="contextId">Id of the entity to which the files are attached.</param> /// <param name="isMultiple">Whether user should be allowed to upload multiple files at once.</param> /// <param name="metadata">An arbitrary string indicating the type of file being attached. Can be used for security checks.</param> /// <returns></returns> public static InlineForm InlineForm <TContext>( EntityFileManagerRegister entityFileManagers, int contextId, bool isMultiple = true, string metadata = null) { var contextType = EntityFileManagerRegister.ContextTypeOf <TContext>(); var fileManager = entityFileManagers.GetInstance(contextType); var canUploadFiles = fileManager.CanUploadFiles(contextId); return(new InlineForm { Form = typeof(DocumentUploader).GetFormId(), InputFieldValues = new Dictionary <string, object> { { nameof(Request.ContextType), contextType }, { nameof(Request.ContextId), contextId }, { nameof(Request.IsMultipe), isMultiple }, { nameof(Request.MetaTag), metadata } } }); }
public DetachFile(IFileManager context, EntityFileManagerRegister documentSecurityRule, UserContext userContext) { this.context = context; this.documentSecurityRules = documentSecurityRule; this.userContext = userContext; }
public WorkItemOverview(CoreDbContext context, UserSecurityContext userSecurityContext, EntityFileManagerRegister entityFileManagerRegister) { this.context = context; this.userSecurityContext = userSecurityContext; this.entityFileManagerRegister = entityFileManagerRegister; }