refactoring
This commit is contained in:
parent
49826eae4a
commit
8e8f4d3896
367 changed files with 217 additions and 364 deletions
26
src/Yavsc.Server/ViewModels/Auth/EditRequirement.cs
Normal file
26
src/Yavsc.Server/ViewModels/Auth/EditRequirement.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
namespace Yavsc.ViewModels.Auth
|
||||
{
|
||||
public class EditPermission : IAuthorizationRequirement
|
||||
{
|
||||
public EditPermission()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class ReadPermission: IAuthorizationRequirement
|
||||
{
|
||||
public ReadPermission()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class DeletePermission: IAuthorizationRequirement
|
||||
{
|
||||
public DeletePermission()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
25
src/Yavsc.Server/ViewModels/Auth/FileSpotInfo.cs
Normal file
25
src/Yavsc.Server/ViewModels/Auth/FileSpotInfo.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Yavsc.Models.Blog;
|
||||
|
||||
namespace Yavsc.ViewModels.Auth {
|
||||
|
||||
public class FileSpotInfo : IAuthorizationRequirement
|
||||
{
|
||||
public DirectoryInfo PathInfo { get; private set; }
|
||||
|
||||
public FileSpotInfo(string path, BlogPost b) {
|
||||
PathInfo = new DirectoryInfo(path);
|
||||
AuthorId = b.AuthorId;
|
||||
BlogEntryId = b.Id;
|
||||
}
|
||||
public string AuthorId { get; private set; }
|
||||
public long BlogEntryId { get; private set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
namespace Yavsc.ViewModels.Auth
|
||||
{
|
||||
public class ModerationRequirement : IAuthorizationRequirement
|
||||
{
|
||||
public ModerationRequirement() {}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
namespace Yavsc.ViewModels.Auth
|
||||
{
|
||||
public class PrivateChatEntryRequirement : IAuthorizationRequirement
|
||||
{
|
||||
}
|
||||
}
|
||||
12
src/Yavsc.Server/ViewModels/Auth/ViewFileContext.cs
Normal file
12
src/Yavsc.Server/ViewModels/Auth/ViewFileContext.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
|
||||
namespace Yavsc.ViewModels.Auth
|
||||
{
|
||||
public class ViewFileContext
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public IFileInfo File { get; set; }
|
||||
public string Path { get; set; }
|
||||
}
|
||||
}
|
||||
11
src/Yavsc.Server/ViewModels/Auth/ViewRequirement.cs
Normal file
11
src/Yavsc.Server/ViewModels/Auth/ViewRequirement.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
namespace Yavsc.ViewModels.Auth
|
||||
{
|
||||
public class ViewRequirement : IAuthorizationRequirement
|
||||
{
|
||||
public ViewRequirement()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue