Dynamic User Roles
This commit is contained in:
		
							
								
								
									
										40
									
								
								Oqtane.Client/Modules/Admin/Roles/Index.razor
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								Oqtane.Client/Modules/Admin/Roles/Index.razor
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,40 @@
 | 
			
		||||
@using Oqtane.Services
 | 
			
		||||
@using Oqtane.Models
 | 
			
		||||
@using Oqtane.Modules
 | 
			
		||||
@using Oqtane.Client.Modules.Controls
 | 
			
		||||
@inherits ModuleBase
 | 
			
		||||
@inject IRoleService RoleService
 | 
			
		||||
 | 
			
		||||
@if (Roles == null)
 | 
			
		||||
{
 | 
			
		||||
    <p><em>Loading...</em></p>
 | 
			
		||||
}
 | 
			
		||||
else
 | 
			
		||||
{
 | 
			
		||||
    <table class="table">
 | 
			
		||||
        <thead>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <th>Name</th>
 | 
			
		||||
            </tr>
 | 
			
		||||
        </thead>
 | 
			
		||||
        <tbody>
 | 
			
		||||
            @foreach (var Role in Roles)
 | 
			
		||||
            {
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>@Role.Name</td>
 | 
			
		||||
                </tr>
 | 
			
		||||
            }
 | 
			
		||||
        </tbody>
 | 
			
		||||
    </table>
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@code {
 | 
			
		||||
    public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Admin; } }
 | 
			
		||||
 | 
			
		||||
    List<Role> Roles;
 | 
			
		||||
 | 
			
		||||
    protected override async Task OnInitializedAsync()
 | 
			
		||||
    {
 | 
			
		||||
        Roles = await RoleService.GetRolesAsync(PageState.Site.SiteId);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user