uml pdf, announcements auth page, winforms dashboard perms
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using StudentHouseDashboard.Managers;
|
||||
|
||||
namespace WebApp.Pages
|
||||
{
|
||||
[Authorize]
|
||||
public class AnnouncementModel : PageModel
|
||||
{
|
||||
public void OnGet(int id)
|
||||
|
@@ -1,9 +1,11 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using StudentHouseDashboard.Managers;
|
||||
|
||||
namespace WebApp.Pages
|
||||
{
|
||||
[Authorize]
|
||||
public class AnnouncementsModel : PageModel
|
||||
{
|
||||
public AnnouncementManager AnnouncementManager { get; set; }
|
||||
|
@@ -28,6 +28,9 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-page="/Login">Login</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-page="/Register">Register</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -31,6 +31,7 @@ namespace WebApp
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapRazorPages();
|
||||
|
@@ -20,7 +20,13 @@ namespace WinForms
|
||||
this.loginForm = loginForm;
|
||||
InitializeComponent();
|
||||
lblUserStatus.Text = $"Logged in as: {user.Role} {user.Name}";
|
||||
if (user.Role == UserRole.ADMIN || user.Role == UserRole.MANAGER)
|
||||
if (user.Role == UserRole.MANAGER)
|
||||
{
|
||||
btnCreateUser.Enabled = false;
|
||||
btnDeleteUser.Enabled = false;
|
||||
btnUpdateUser.Enabled = true;
|
||||
}
|
||||
else if (user.Role == UserRole.ADMIN)
|
||||
{
|
||||
btnCreateUser.Enabled = true;
|
||||
btnDeleteUser.Enabled = true;
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user