Skip to content

FileReadAccessSettings class

namespace: Serenity.Web   assembly: Serenity.Net.Core

Settings for file read access control.

public class FileReadAccessSettings : IOptions<FileReadAccessSettings>

Public Members

name description
FileReadAccessSettings() The default constructor.
BypassPermission { get; set; } Permission that bypasses all file read access checks. You may set this to a special permission like "Administration:General" to allow administrators to read all files.
DefaultPermission { get; set; } Permission to check when no FileReadAccess attribute is present, or its PermissionOnly is true but no permission is specified. Default is "*" for compat, e.g. allow access to anyone that have access to the entity.
EnableAccessLogging { get; set; } Whether to log access control decisions for debugging
MissingMetadataPermission { get; set; } Permission to check when file metadata is missing or cannot be read. Default is null, e.g. DefaultPermission is used.
PathPermissions { get; set; } Regular expression patterns for paths and corresponding permissions that are handled before checking file access permissions. Default is "^public/:;^temporary/:" for allowing public access to files under "public/" and "temporary/". Separate multiple patterns with semicolon (;). The format is "pattern:permission", where pattern is a regular expression to match the file path, and permission is the permission to check if the pattern matches. Use "*" for public access, "?" for logged-in users, "NEVER" to block access or a specific permission. Patterns are evaluated in order, and the first match is used.
ReturnForbidResult { get; set; } Whether to return "forbidden" (403) result instead of the default "not found" (404).
Value { get; }
const SectionKey The default section key in appsettings.json

See Also