diff --git a/web/Controllers/CustomerController.cs b/web/Controllers/CustomerController.cs index dec7e0c..9598608 100644 --- a/web/Controllers/CustomerController.cs +++ b/web/Controllers/CustomerController.cs @@ -127,6 +127,7 @@ public async Task Details(int? id) } // GET: Customer/Create + [Authorize(Roles = "Administrator, Manager")] public IActionResult Create() { return View(); @@ -149,6 +150,7 @@ public async Task Create([Bind("ID,FirstName,LastName,Address,ZIP } // GET: Customer/Edit/5 + [Authorize(Roles = "Administrator, Manager")] public async Task Edit(int? id) { if (id == null) @@ -200,6 +202,7 @@ public async Task Edit(int id, [Bind("ID,FirstName,LastName,Addre } // GET: Customer/Delete/5 + [Authorize(Roles = "Administrator, Manager")] public async Task Delete(int? id) { if (id == null) diff --git a/web/Controllers/DistributorController.cs b/web/Controllers/DistributorController.cs index 5b98b58..9892394 100644 --- a/web/Controllers/DistributorController.cs +++ b/web/Controllers/DistributorController.cs @@ -120,6 +120,7 @@ public async Task Details(int? id) } // GET: Distributor/Create + [Authorize(Roles = "Administrator, Manager")] public IActionResult Create() { return View(); @@ -142,6 +143,7 @@ public async Task Create([Bind("ID,Name,Address,ZIP,City,Country" } // GET: Distributor/Edit/5 + [Authorize(Roles = "Administrator, Manager")] public async Task Edit(int? id) { if (id == null) @@ -193,6 +195,7 @@ public async Task Edit(int id, [Bind("ID,Name,Address,ZIP,City,Co } // GET: Distributor/Delete/5 + [Authorize(Roles = "Administrator, Manager")] public async Task Delete(int? id) { if (id == null) diff --git a/web/Controllers/EvidenceController.cs b/web/Controllers/EvidenceController.cs index 5fd3029..fea669a 100644 --- a/web/Controllers/EvidenceController.cs +++ b/web/Controllers/EvidenceController.cs @@ -149,6 +149,7 @@ public async Task Create([Bind("ID,ItemID,WarehouseID,CustomerID, } // GET: Evidence/Edit/5 + [Authorize(Roles = "Administrator, Manager")] public async Task Edit(int? id) { if (id == null) @@ -206,6 +207,7 @@ public async Task Edit(int id, [Bind("ID,ItemID,WarehouseID,Custo } // GET: Evidence/Delete/5 + [Authorize(Roles = "Administrator, Manager")] public async Task Delete(int? id) { if (id == null) diff --git a/web/Views/Customer/Index.cshtml b/web/Views/Customer/Index.cshtml index 81d282f..0004da9 100644 --- a/web/Views/Customer/Index.cshtml +++ b/web/Views/Customer/Index.cshtml @@ -67,9 +67,14 @@ @Html.DisplayFor(modelItem => item.Country) - Edit | - Details | - Delete + Details + @if (User.Identity.IsAuthenticated) + { + if (User.IsInRole("Administrator") || User.IsInRole("Manager")) { + Edit + Delete + } + } } diff --git a/web/Views/Distributor/Index.cshtml b/web/Views/Distributor/Index.cshtml index 19357eb..516b16e 100644 --- a/web/Views/Distributor/Index.cshtml +++ b/web/Views/Distributor/Index.cshtml @@ -60,9 +60,15 @@ @Html.DisplayFor(modelItem => item.Country) - Edit | - Details | - Delete + Details + @if (User.Identity.IsAuthenticated) + { + if (User.IsInRole("Administrator") || User.IsInRole("Manager")) + { + Edit + Delete + } + } } diff --git a/web/Views/Evidence/Index.cshtml b/web/Views/Evidence/Index.cshtml index 49a3f40..45188a4 100644 --- a/web/Views/Evidence/Index.cshtml +++ b/web/Views/Evidence/Index.cshtml @@ -55,9 +55,17 @@ @Html.DisplayFor(modelItem => item.Customer.LastName), @Html.DisplayFor(modelItem => item.Customer.FirstName) - Edit | - Details | - Delete + Details + @if (User.Identity.IsAuthenticated) + { + + if (User.IsInRole("Administrator") || User.IsInRole("Manager")) + { + Edit + Delete + } + } + } diff --git a/web/Views/Item/Index.cshtml b/web/Views/Item/Index.cshtml index 2a20471..be9f771 100644 --- a/web/Views/Item/Index.cshtml +++ b/web/Views/Item/Index.cshtml @@ -10,6 +10,18 @@
+
+
+

+ Find by name: + + @* Filter by activity: + | *@ + Clear filter + Add New +

+
+
diff --git a/web/Views/Warehouse/Index.cshtml b/web/Views/Warehouse/Index.cshtml index c27ea8e..4a45372 100644 --- a/web/Views/Warehouse/Index.cshtml +++ b/web/Views/Warehouse/Index.cshtml @@ -58,13 +58,12 @@ { if (User.IsInRole("Manager")) { - Edit + Edit } else if (User.IsInRole("Administrator")) { - Edit - Delete - Create + Edit + Delete } }