using System.Collections.Immutable; namespace Barotrauma.LuaCs.Services.Safe; public interface ISafeStorageService : IStorageService { /// /// Checks the given file path to see if it can be read. This includes any permissions, whitelists and OS checks. /// /// The absolute path to the file. /// Whether to only check for read permissions only, or full RWM if false. /// Whether to only check if the file is safe to access, without checking accessibility at the OS level. /// Whether the file is accessible. bool IsFileAccessible(string path, bool readOnly, bool checkWhitelistOnly = true); /// /// Adds the given path to the specified whitelists. /// /// Either the fully-qualified or local reference path to the given file. /// void AddFileToWhitelist(string path, bool readOnly = true); /// /// Removes the given path from all whitelists (Read|Write). /// /// void RemoveFileFromAllWhitelists(string path); /// /// Sets the whitelist filtering for read-only file permissions for the instance. /// /// List of absolute file paths allowed. FluentResults.Result SetReadOnlyWhitelist(ImmutableArray filePaths); /// /// Sets the whitelist filtering for read & write file permissions for the instance. /// /// List of absolute file paths allowed. FluentResults.Result SetReadWriteWhitelist(ImmutableArray filePaths); /// /// Deletes all paths from all white lists. /// void ClearAllWhitelists(); }