aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Startup.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-13 16:20:45 +0800
committerGitHub <noreply@github.com>2020-11-13 16:20:45 +0800
commit381cb7c64123c71899f549baa16bb610cc8b037f (patch)
treedfb4dd690704e887e3609265e6a652fe7ccea218 /BackEnd/Timeline/Startup.cs
parent5b78017e93450342c85a0e7f5ed16bbb6ae8422e (diff)
parentb635b4453756d9a33c173c9b9f2ae0ab7c830d3b (diff)
downloadtimeline-381cb7c64123c71899f549baa16bb610cc8b037f.tar.gz
timeline-381cb7c64123c71899f549baa16bb610cc8b037f.tar.bz2
timeline-381cb7c64123c71899f549baa16bb610cc8b037f.zip
Merge pull request #183 from crupest/auth
Refactor auth module to enable more flexiable permission control.
Diffstat (limited to 'BackEnd/Timeline/Startup.cs')
-rw-r--r--BackEnd/Timeline/Startup.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Startup.cs b/BackEnd/Timeline/Startup.cs
index 576836eb..532c63d0 100644
--- a/BackEnd/Timeline/Startup.cs
+++ b/BackEnd/Timeline/Startup.cs
@@ -1,4 +1,5 @@
using AutoMapper;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
@@ -72,6 +73,8 @@ namespace Timeline
.AddScheme<MyAuthenticationOptions, MyAuthenticationHandler>(AuthenticationConstants.Scheme, AuthenticationConstants.DisplayName, o => { });
services.AddAuthorization();
+ services.AddSingleton<IAuthorizationPolicyProvider, PermissionPolicyProvider>();
+
services.AddSingleton<IPathProvider, PathProvider>();
services.AddSingleton<IDatabaseBackupService, DatabaseBackupService>();
@@ -85,6 +88,7 @@ namespace Timeline
services.AddScoped<IUserDeleteService, UserDeleteService>();
services.AddScoped<IUserTokenService, JwtUserTokenService>();
services.AddScoped<IUserTokenManager, UserTokenManager>();
+ services.AddScoped<IUserPermissionService, UserPermissionService>();
services.AddScoped<IETagGenerator, ETagGenerator>();
services.AddScoped<IDataManager, DataManager>();