From e94c8a373c576eb10493ed512b66c6c6e75fc788 Mon Sep 17 00:00:00 2001 From: Ilya Chumakov Date: Thu, 15 Jun 2017 23:25:23 +0300 Subject: [PATCH] Update all packages. --- .../Controllers/ResourceController.cs | 6 ++--- ...PaperSource.AspNetCoreAuthorization.csproj | 26 +++++++++---------- .../Program.cs | 1 - .../Properties/launchSettings.json | 23 +++++----------- .../Views/Home/Index.cshtml | 14 +++++++--- 5 files changed, 33 insertions(+), 37 deletions(-) diff --git a/src/PaperSource.AspNetCoreAuthorization/Controllers/ResourceController.cs b/src/PaperSource.AspNetCoreAuthorization/Controllers/ResourceController.cs index 69913fa..6b4f94f 100644 --- a/src/PaperSource.AspNetCoreAuthorization/Controllers/ResourceController.cs +++ b/src/PaperSource.AspNetCoreAuthorization/Controllers/ResourceController.cs @@ -17,14 +17,14 @@ public ResourceController(IAuthorizationService authorizationService) public async Task ExampleV1(int id) { - Order order = new Order(); //получим ресурс из БД + Order order = new Order(); //get resourse from DB if (await _authorizationService.AuthorizeAsync(this.User, order, "resource-allow-policy")) { return View("OK"); } - return new ChallengeResult(); //вернем 401 или 403 (в зависимости от состояния пользователя) + return new ChallengeResult(); //it produces 401 or 403 response (depending on user state) } public async Task ExampleV2() @@ -36,7 +36,7 @@ public async Task ExampleV2() return View("OK"); } - return new ChallengeResult(); //вернем 401 или 403 (в зависимости от состояния пользователя) + return new ChallengeResult(); //it produces 401 or 403 response (depending on user state) } } } diff --git a/src/PaperSource.AspNetCoreAuthorization/PaperSource.AspNetCoreAuthorization.csproj b/src/PaperSource.AspNetCoreAuthorization/PaperSource.AspNetCoreAuthorization.csproj index 7f9ecb9..0538857 100644 --- a/src/PaperSource.AspNetCoreAuthorization/PaperSource.AspNetCoreAuthorization.csproj +++ b/src/PaperSource.AspNetCoreAuthorization/PaperSource.AspNetCoreAuthorization.csproj @@ -11,19 +11,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/PaperSource.AspNetCoreAuthorization/Program.cs b/src/PaperSource.AspNetCoreAuthorization/Program.cs index deb09b4..31459c4 100644 --- a/src/PaperSource.AspNetCoreAuthorization/Program.cs +++ b/src/PaperSource.AspNetCoreAuthorization/Program.cs @@ -10,7 +10,6 @@ public static void Main(string[] args) var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() .UseStartup() .Build(); diff --git a/src/PaperSource.AspNetCoreAuthorization/Properties/launchSettings.json b/src/PaperSource.AspNetCoreAuthorization/Properties/launchSettings.json index 3fa2e56..fcec24f 100644 --- a/src/PaperSource.AspNetCoreAuthorization/Properties/launchSettings.json +++ b/src/PaperSource.AspNetCoreAuthorization/Properties/launchSettings.json @@ -1,24 +1,15 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:19728/", - "sslPort": 0 + "Kestrel": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "PaperSource.AspNetCoreAuthorization": { + "Kestrel": { "commandName": "Project", - "launchBrowser": true, - "launchUrl": "http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/PaperSource.AspNetCoreAuthorization/Views/Home/Index.cshtml b/src/PaperSource.AspNetCoreAuthorization/Views/Home/Index.cshtml index 745d62a..2383e03 100644 --- a/src/PaperSource.AspNetCoreAuthorization/Views/Home/Index.cshtml +++ b/src/PaperSource.AspNetCoreAuthorization/Views/Home/Index.cshtml @@ -11,6 +11,8 @@
@Html.ActionLink("Allow", "Allow", "Policy")
+
+
@Html.ActionLink("Deny", "Deny", "Policy")
@@ -21,10 +23,12 @@

Resource-based:

- @Html.ActionLink("ExampleV1", "ExampleV1", "Resource") + @Html.ActionLink("ExampleV1 (Allow)", "ExampleV1", "Resource") +
+
+ @Html.ActionLink("ExampleV2 (Allow)", "ExampleV2", "Resource")
- @Html.ActionLink("ExampleV2", "ExampleV2", "Resource")
@@ -33,10 +37,12 @@

Permission-based:

- @Html.ActionLink("ExampleV1", "ExampleV1", "Permission") + @Html.ActionLink("ExampleV1 (Allow)", "ExampleV1", "Permission") +
+
+ @Html.ActionLink("ExampleV2 (Allow)", "ExampleV2", "Permission")
- @Html.ActionLink("ExampleV2", "ExampleV2", "Permission")