39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
@namespace Oqtane.Modules.Admin.Users
|
|
@inherits ModuleBase
|
|
@inject IUserRoleService UserRoleService
|
|
|
|
@if (userroles == null)
|
|
{
|
|
<p><em>Loading...</em></p>
|
|
}
|
|
else
|
|
{
|
|
<ActionLink Action="Add" Text="Add User" Style="float: right; margin: 10px;" />
|
|
|
|
<Pager Items="@userroles">
|
|
<Header>
|
|
<th>Name</th>
|
|
<th> </th>
|
|
<th> </th>
|
|
<th> </th>
|
|
</Header>
|
|
<Row>
|
|
<td>@context.User.DisplayName</td>
|
|
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.UserId.ToString())" /></td>
|
|
<td><ActionLink Action="Delete" Parameters="@($"id=" + context.UserId.ToString())" Class="btn btn-danger" /></td>
|
|
<td><ActionLink Action="Roles" Parameters="@($"id=" + context.UserId.ToString())" /></td>
|
|
</Row>
|
|
</Pager>
|
|
}
|
|
|
|
@code {
|
|
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Admin; } }
|
|
|
|
List<UserRole> userroles;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
userroles = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId);
|
|
userroles = userroles.Where(item => item.Role.Name == Constants.RegisteredRole).ToList();
|
|
}
|
|
} |