Skip to content

Commit

Permalink
remove role management in solution (#91)
Browse files Browse the repository at this point in the history
Co-authored-by: Beaugrand, Kevin <[email protected]>
  • Loading branch information
kbeaugrand and kbeaugrand authored Jan 23, 2022
1 parent 1883eed commit 52e0539
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion src/AzureIoTHub.Portal/Client/Pages/Users/Delete.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@using AzureIoTHub.Portal.Shared.Security

@attribute [Authorize(Roles = RoleNames.Admin)]
@inject HttpClient Http
@inject IJSRuntime JS

Expand Down
1 change: 0 additions & 1 deletion src/AzureIoTHub.Portal/Client/Pages/Users/Invite.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

@using AzureIoTHub.Portal.Shared.Security
@using AzureIoTHub.Portal.Shared.UserManagement
@attribute [Authorize(Roles = RoleNames.Admin)]
@inject HttpClient Http
@inject IJSRuntime JS

Expand Down
1 change: 0 additions & 1 deletion src/AzureIoTHub.Portal/Client/Pages/Users/Users.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@using Blazored.Modal
@using Blazored.Modal.Services

@attribute [Authorize(Roles = RoleNames.Admin)]
@inject HttpClient Http
@inject IModalService modal
@inject IJSRuntime JS
Expand Down
5 changes: 1 addition & 4 deletions src/AzureIoTHub.Portal/Client/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
<AuthorizeView>
<Authorized>
<MudNavLink Href="/devices">Devices</MudNavLink>
@if (context.User.IsInRole(RoleNames.Admin))
{
<MudNavLink Href="/users">Users</MudNavLink>
}
<MudNavLink Href="/users">Users</MudNavLink>
<MudNavGroup Title="Gateways" Expanded="true">
<MudNavLink Href="/gateways">Overview</MudNavLink>
<MudNavLink Href="/configurations">Configuration</MudNavLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace AzureIoTHub.Portal.Server.Controllers
[Authorize]
[ApiController]
[Route("api/[controller]")]
[Authorize(Roles = RoleNames.Admin)]
public class CommandsController : ControllerBase
{
private readonly ITableClientFactory tableClientFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace AzureIoTHub.Portal.Server.Controllers
[Authorize]
[ApiController]
[Route("api/[controller]")]
[Authorize(Roles = RoleNames.Admin)]

public class ConfigsController : ControllerBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace AzureIoTHub.Portal.Server.Controllers
[Authorize]
[ApiController]
[Route("api/[controller]")]
[Authorize(Roles = RoleNames.Admin)]
public class DeviceModelsController : ControllerBase
{
private const string DefaultPartitionKey = "0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace AzureIoTHub.Portal.Server.Controllers
using Microsoft.Azure.Devices.Shared;
using Microsoft.Extensions.Logging;

[Authorize(Roles = RoleNames.Admin)]
[ApiController]
[Route("api/[controller]")]
public class DevicesController : ControllerBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace AzureIoTHub.Portal.Server.Controllers
[Authorize]
[ApiController]
[Route("api/[controller]")]
[Authorize(Roles = RoleNames.Admin)]
public class GatewaysController : ControllerBase
{
private readonly ILogger<GatewaysController> logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace AzureIoTHub.Portal.Server.Controllers

[ApiController]
[Route("api/[controller]")]
[Authorize(Roles = RoleNames.Admin)]
public class UsersController : Controller
{
private readonly GraphServiceClient graphClient;
Expand Down
1 change: 0 additions & 1 deletion src/AzureIoTHub.Portal/Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public void ConfigureServices(IServiceCollection services)
.AddMicrosoftIdentityWebApi(
jwtOopts =>
{
jwtOopts.TokenValidationParameters.RoleClaimType = "extension_Role";
},
identityOpts =>
{
Expand Down

0 comments on commit 52e0539

Please sign in to comment.