add PrincipalPolicy
This commit is contained in:
		
							parent
							
								
									1cdec275cb
								
							
						
					
					
						commit
						7457cbbf0e
					
				| @ -14,7 +14,8 @@ namespace EnotaryoPH.Web | ||||
|             builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) | ||||
|                 .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, | ||||
|                 options => options.LoginPath = new Microsoft.AspNetCore.Http.PathString("/Login")); | ||||
|             builder.Services.AddRazorPages(); | ||||
|             builder.Services.AddAuthorization(options => options.AddPolicy("PrincipalPolicy", policy => policy.RequireRole("Principal"))); | ||||
|             builder.Services.AddRazorPages(options => options.Conventions.AuthorizeFolder("/Principal", "PrincipalPolicy")); | ||||
|             builder.Services.AddDbContext<NotaryoDBContext>(); | ||||
|             builder.Services.AddTransient<IPasswordService, PasswordService>(); | ||||
|             builder.Services.AddHttpContextAccessor(); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user