diff --git a/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml.cs b/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml.cs index 84e8773..c0764d1 100644 --- a/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml.cs +++ b/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml.cs @@ -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) diff --git a/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml.cs b/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml.cs index 86dc7f2..7021696 100644 --- a/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml.cs +++ b/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml.cs @@ -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; } diff --git a/StudentHouseDashboard/WebApp/Pages/Shared/_Layout.cshtml b/StudentHouseDashboard/WebApp/Pages/Shared/_Layout.cshtml index 74662f4..b37d7fc 100644 --- a/StudentHouseDashboard/WebApp/Pages/Shared/_Layout.cshtml +++ b/StudentHouseDashboard/WebApp/Pages/Shared/_Layout.cshtml @@ -28,6 +28,9 @@ + diff --git a/StudentHouseDashboard/WebApp/Program.cs b/StudentHouseDashboard/WebApp/Program.cs index b24c474..abbb8e9 100644 --- a/StudentHouseDashboard/WebApp/Program.cs +++ b/StudentHouseDashboard/WebApp/Program.cs @@ -31,6 +31,7 @@ namespace WebApp app.UseRouting(); + app.UseAuthentication(); app.UseAuthorization(); app.MapRazorPages(); diff --git a/StudentHouseDashboard/WinForms/Dashboard.cs b/StudentHouseDashboard/WinForms/Dashboard.cs index 6db7277..6b4a9cd 100644 --- a/StudentHouseDashboard/WinForms/Dashboard.cs +++ b/StudentHouseDashboard/WinForms/Dashboard.cs @@ -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; diff --git a/docs/umlclass.pdf b/docs/umlclass.pdf index dacd694..594a2e9 100644 Binary files a/docs/umlclass.pdf and b/docs/umlclass.pdf differ