From d6b15634ef33c831a8d6deadd569c7c30b214de9 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sat, 3 Aug 2019 11:43:14 +0200 Subject: [PATCH] init a fs manager --- src/Yavsc/Services/IFileSystemAuthManager.cs | 55 ++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/Yavsc/Services/IFileSystemAuthManager.cs diff --git a/src/Yavsc/Services/IFileSystemAuthManager.cs b/src/Yavsc/Services/IFileSystemAuthManager.cs new file mode 100644 index 00000000..9e13294e --- /dev/null +++ b/src/Yavsc/Services/IFileSystemAuthManager.cs @@ -0,0 +1,55 @@ +using System; +using System.Security.Principal; +using Yavsc.Models; + +namespace Yavsc.Services { + [Flags] + public enum FileAccessRight { + None = 0, + + Read = 1, + Write = 2 + } + + public interface IFileSystemAuthManager { + string NormalizePath (string path); + + /// + /// A full path starts with a slash, + /// continues with a user name, + /// and returns true by the helper fonction : + /// + /// + /// + /// + FileAccessRight GetFilePathAccess(IPrincipal user, string normalizedFullPath); + + void SetAccess (long circleId, string normalizedFullPath, FileAccessRight access); + + } + + public class FileSystemAuthManager : IFileSystemAuthManager + { + ApplicationDbContext _dbContext; + + public FileSystemAuthManager(ApplicationDbContext dbContext) + { + _dbContext = dbContext; + } + + public FileAccessRight GetFilePathAccess(IPrincipal user, string normalizedFullPath) + { + throw new NotImplementedException(); + } + + public string NormalizePath(string path) + { + throw new NotImplementedException(); + } + + public void SetAccess(long circleId, string normalizedFullPath, FileAccessRight access) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file