Skip to content

Commit

Permalink
Update all packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-chumakov committed Jun 15, 2017
1 parent 986d273 commit e94c8a3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public ResourceController(IAuthorizationService authorizationService)

public async Task<IActionResult> 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<IActionResult> ExampleV2()
Expand All @@ -36,7 +36,7 @@ public async Task<IActionResult> ExampleV2()
return View("OK");
}

return new ChallengeResult(); //вернем 401 или 403 (в зависимости от состояния пользователя)
return new ChallengeResult(); //it produces 401 or 403 response (depending on user state)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.2" />
</ItemGroup>

<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
Expand Down
1 change: 0 additions & 1 deletion src/PaperSource.AspNetCoreAuthorization/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public static void Main(string[] args)
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down
14 changes: 10 additions & 4 deletions src/PaperSource.AspNetCoreAuthorization/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<div class="col-sm-2 h4">
@Html.ActionLink("Allow", "Allow", "Policy")
</div>
<div class="col-sm-2 h4">
</div>
<div class="col-sm-2 h4">
@Html.ActionLink("Deny", "Deny", "Policy")
</div>
Expand All @@ -21,10 +23,12 @@
<h4>Resource-based: </h4>
</div>
<div class="col-sm-2 h4">
@Html.ActionLink("ExampleV1", "ExampleV1", "Resource")
@Html.ActionLink("ExampleV1 (Allow)", "ExampleV1", "Resource")
</div>
<div class="col-sm-2 h4">
@Html.ActionLink("ExampleV2 (Allow)", "ExampleV2", "Resource")
</div>
<div class="col-sm-2 h4">
@Html.ActionLink("ExampleV2", "ExampleV2", "Resource")
</div>
</div>

Expand All @@ -33,10 +37,12 @@
<h4>Permission-based: </h4>
</div>
<div class="col-sm-2 h4">
@Html.ActionLink("ExampleV1", "ExampleV1", "Permission")
@Html.ActionLink("ExampleV1 (Allow)", "ExampleV1", "Permission")
</div>
<div class="col-sm-2 h4">
@Html.ActionLink("ExampleV2 (Allow)", "ExampleV2", "Permission")
</div>
<div class="col-sm-2 h4">
@Html.ActionLink("ExampleV2", "ExampleV2", "Permission")
</div>
</div>

Expand Down

0 comments on commit e94c8a3

Please sign in to comment.