2019-08-03 11:43:14 +02:00
|
|
|
using System;
|
2019-08-04 11:45:00 +02:00
|
|
|
using System.Security.Claims;
|
2019-08-03 11:43:14 +02:00
|
|
|
using System.Security.Principal;
|
2020-10-17 23:40:37 +01:00
|
|
|
using Microsoft.AspNet.FileProviders;
|
2019-08-03 11:43:14 +02:00
|
|
|
|
2019-08-04 11:45:00 +02:00
|
|
|
namespace Yavsc.Services
|
|
|
|
|
{
|
2019-08-03 11:43:14 +02:00
|
|
|
[Flags]
|
|
|
|
|
public enum FileAccessRight {
|
|
|
|
|
None = 0,
|
|
|
|
|
|
|
|
|
|
Read = 1,
|
|
|
|
|
Write = 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IFileSystemAuthManager {
|
|
|
|
|
string NormalizePath (string path);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A full path starts with a slash,
|
|
|
|
|
/// continues with a user name,
|
|
|
|
|
/// and returns true by the helper fonction :
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="user"></param>
|
|
|
|
|
/// <param name="normalizedFullPath"></param>
|
|
|
|
|
/// <returns></returns>
|
2020-10-17 23:40:37 +01:00
|
|
|
FileAccessRight GetFilePathAccess(ClaimsPrincipal user, IFileInfo file);
|
2019-08-03 11:43:14 +02:00
|
|
|
|
|
|
|
|
void SetAccess (long circleId, string normalizedFullPath, FileAccessRight access);
|
|
|
|
|
|
|
|
|
|
}
|
2020-10-17 23:40:37 +01:00
|
|
|
}
|