Index: PostgreSqlDotnetCore/Controllers/BlogController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/BlogController.cs	(revision 57fc40271dfe03c973365d9799d1dbf2d4360b8f)
+++ PostgreSqlDotnetCore/Controllers/BlogController.cs	(revision 72b1da27c6dadc5f1ae45e91e7c4f60289917575)
@@ -30,22 +30,51 @@
         */
 
-        public async Task<ActionResult> Index()
-        {
-            // Проверка за автентикација
-            bool isAuthenticated = User.Identity.IsAuthenticated;
-
-            if (!isAuthenticated)
-            {
-                return RedirectToAction("AccessDenied", "Error");
-            }
-
-            // Список на блог постови
-            var blogPosts = await db.BlogPostControllerObj.ToListAsync();
-
-            // Предавање на ViewBag за проверка на автентикација
-            ViewBag.isAuthenticated = isAuthenticated;
-
-            return View(blogPosts);
-        }
+        /* public async Task<ActionResult> Index()
+         {
+             // Проверка за автентикација
+             bool isAuthenticated = User.Identity.IsAuthenticated;
+
+             if (!isAuthenticated)
+             {
+                 return RedirectToAction("AccessDenied", "Error");
+             }
+
+             // Список на блог постови
+             var blogPosts = await db.BlogPostControllerObj.ToListAsync();
+
+             // Предавање на ViewBag за проверка на автентикација
+             ViewBag.isAuthenticated = isAuthenticated;
+
+             return View(blogPosts);
+         }*/
+
+          public async Task<ActionResult> Index()
+          {
+              // Проверка за автентикација
+              bool isAuthenticated = User.Identity.IsAuthenticated;
+
+              if (!isAuthenticated)
+              {
+                  return RedirectToAction("AccessDenied", "Error");
+              }
+
+              // Список на блог постови
+              var blogPosts = await db.BlogPostControllerObj.ToListAsync();
+
+              // Вземи тековниот корисник
+              var currentUser = await _userManager.GetUserAsync(User);
+              var customerClass = await db.CustomerObj.SingleOrDefaultAsync(x => x.email == currentUser.Email);
+
+              // Предавање на ViewBag за проверка на автентикација и корисничкиот ID
+              ViewBag.isAuthenticated = isAuthenticated;
+              ViewBag.CurrentUserId = customerClass?.id;
+
+              return View(blogPosts);
+          }
+        
+
+        
+
+
         // GET: Customer/Details/5
         public async Task<ActionResult> DetailsAsync(int? id)
@@ -100,36 +129,37 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-         public async Task<ActionResult> CreateAsync([Bind(include: "id,date_askes,title,description,users_id")] BlogPostConsultation blogClass)
-         {
-             if (ModelState.IsValid)
-             {
-                 bool isAuthenticated = User.Identity.IsAuthenticated;
-                 if (isAuthenticated)
-                 {
-                     var user = await _userManager.GetUserAsync(User);
-                     var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
-                     if (customerClass != null)
-                     {
-                         // Поставете users_id на идентификаторот на корисникот
-                         blogClass.users_id = customerClass.id;
+        public async Task<ActionResult> CreateAsync([Bind(include: "id,date_askes,title,description,users_id")] BlogPostConsultation blogClass)
+        {
+            if (ModelState.IsValid)
+            {
+                bool isAuthenticated = User.Identity.IsAuthenticated;
+                if (isAuthenticated)
+                {
+                    var user = await _userManager.GetUserAsync(User);
+                    var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
+                    if (customerClass != null)
+                    {
+                        // Поставете users_id на идентификаторот на корисникот
+                        blogClass.users_id = customerClass.id;
                         //blogClass.date_askes = DateOnly.FromDateTime(DateTime.UtcNow); 
                         blogClass.date_askes = DateOnly.FromDateTime(DateTime.Now); // Ова ќе стави локално време
 
                         db.BlogPostControllerObj.Add(blogClass);
-                         await db.SaveChangesAsync();
-                         return RedirectToAction("Index");
-                     }
-                 }
-                 else
-                 {
-                     return RedirectToAction("AccessDenied", "Error");
-                 }
-             }
-
-             return View(blogClass);
-         }
-
-       
-       
+                        await db.SaveChangesAsync();
+                        return RedirectToAction("Index");
+                    }
+                }
+                else
+                {
+                    return RedirectToAction("AccessDenied", "Error");
+                }
+            }
+
+            return View(blogClass);
+        }
+
+
+
+
 
 
@@ -151,4 +181,6 @@
             // check for permission
             UsersClass customerClass = await checkAuthorizationAsync();
+            //dodadeno na 23.08
+            ViewBag.isAuthenticated = await getCrrentUser();
             if (customerClass == null)
             {
@@ -174,18 +206,42 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public ActionResult Edit([Bind(include: "id,date_askes,title,description,users_id")] BlogPostConsultation blogClass)
+        /* public ActionResult Edit([Bind(include: "id,date_askes,title,description,users_id")] BlogPostConsultation blogClass)
+         {
+             if (ModelState.IsValid)
+             {
+                 db.Entry(blogClass).State = EntityState.Modified;
+                 db.SaveChanges();
+                 return RedirectToAction("Index");
+             }
+             return View(blogClass);
+         }*/
+
+        
+        public async Task<ActionResult> EditAsync(int id, [Bind(include: "id,date_askes,title,description")] BlogPostConsultation blogClass)
         {
             if (ModelState.IsValid)
             {
-                db.Entry(blogClass).State = EntityState.Modified;
-                db.SaveChanges();
-                return RedirectToAction("Index");
-            }
-            return View(blogClass);
-        }
+                var existingBlogClass = await db.BlogPostControllerObj.FindAsync(id);
+                if (existingBlogClass != null)
+                {
+                    // Запамтете ја старата вредност на users_id
+                    blogClass.users_id = existingBlogClass.users_id;
+
+                    db.Entry(existingBlogClass).CurrentValues.SetValues(blogClass);
+                    await db.SaveChangesAsync();
+                    return RedirectToAction("Index");
+                }
+            }
+            return View(blogClass);
+        }
+
+
 
         // GET: Customer/Delete/5
-        public async Task<ActionResult> DeleteAsync(int? id)
-        { 
+        public async Task<ActionResult> DeleteAsync(int? id) { 
+          //  UsersClass customerClass = await checkAuthorizationAsync();
+
+        ViewBag.isAuthenticated = await getCrrentUser();
+        
             if (id == null)
            {
Index: PostgreSqlDotnetCore/Controllers/PetCaresController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/PetCaresController.cs	(revision 57fc40271dfe03c973365d9799d1dbf2d4360b8f)
+++ PostgreSqlDotnetCore/Controllers/PetCaresController.cs	(revision 72b1da27c6dadc5f1ae45e91e7c4f60289917575)
@@ -17,13 +17,28 @@
 
         [HttpGet]
-        public async Task<ActionResult> Create()
-        {
+        /*  public async Task<ActionResult> Create()
+          {
+
+              var vetCenters = await db.VetCentersObj.ToListAsync();
+
+              ViewBag.VetCenters = new SelectList(vetCenters, "id", "name");
+
+              return View();
+          }*/
+         public async Task<ActionResult> Create()
+         {
+             
+             
+            UsersClass customerClass = await getCrrentUser();
             
+            ViewBag.isAuthenticated = customerClass;
             var vetCenters = await db.VetCentersObj.ToListAsync();
-
-            ViewBag.VetCenters = new SelectList(vetCenters, "id", "name");
-
-            return View();
-        }
+             ViewBag.VetCenters = new SelectList(vetCenters, "id", "name");
+
+             return View();
+         }
+
+       
+
 
         // GET: Customer
@@ -111,25 +126,39 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public async Task<ActionResult> CreateAsync([Bind(include: "id,title,description,dateending, start_date, usersid, vetcentersid")] Pet_CaresClass peClass)
-        {
-            bool isAuthenticated = User.Identity.IsAuthenticated;
-            if (!isAuthenticated)
-            {
-                return RedirectToAction("AccessDenied", "Error");
-            }
+         public async Task<ActionResult> CreateAsync([Bind(include: "id,title,description,dateending, start_date, usersid, vetcentersid")] Pet_CaresClass peClass)
+          {
+              bool isAuthenticated = User.Identity.IsAuthenticated;
+              if (!isAuthenticated)
+              {
+                  return RedirectToAction("AccessDenied", "Error");
+              }
+            ViewBag.isAuthenticated = new UsersClass();
+
             if (ModelState.IsValid)
-            {
+              {
+                ViewBag.isAuthenticated = new UsersClass();
                 peClass.dateending = DateTime.SpecifyKind(peClass.dateending, DateTimeKind.Utc);
-                peClass.start_date = DateTime.SpecifyKind(peClass.start_date, DateTimeKind.Utc);
-                var user = await _userManager.GetUserAsync(User);
-                var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
-                peClass.usersid = customerClass.id;
-                db.PetCaresObj.Add(peClass);
-                db.SaveChanges();
-                return RedirectToAction("Index");
-            }
-
-            return View(peClass);
-        }
+                  peClass.start_date = DateTime.SpecifyKind(peClass.start_date, DateTimeKind.Utc);
+                 var user = await _userManager.GetUserAsync(User);
+                  var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
+                  peClass.usersid = customerClass.id;
+                  db.PetCaresObj.Add(peClass);
+                  db.SaveChanges();
+                  return RedirectToAction("Index");
+              }
+              var vetCenters = await db.VetCentersObj.ToListAsync();
+              ViewBag.VetCenters = new SelectList(vetCenters, "id", "name");
+
+              return View(peClass);
+          }
+
+
+
+
+       
+
+
+
+
 
         // GET: Customer/Edit/5
Index: PostgreSqlDotnetCore/Controllers/VetCenterController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/VetCenterController.cs	(revision 57fc40271dfe03c973365d9799d1dbf2d4360b8f)
+++ PostgreSqlDotnetCore/Controllers/VetCenterController.cs	(revision 72b1da27c6dadc5f1ae45e91e7c4f60289917575)
@@ -31,4 +31,16 @@
         }
 
+        /* public async Task<ActionResult> Index()
+         {
+
+             var vetCenters = await db.VetCentersObj.ToListAsync();
+             ViewBag.isAuthenticated = User.Identity.IsAuthenticated;
+
+             // Check if the user is an admin
+             UsersClass customerClass = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin);
+             ViewBag.hasAccess = customerClass != null;
+
+             return View(vetCenters);
+         }*/
         public async Task<ActionResult> Index()
         {
@@ -36,10 +48,13 @@
             ViewBag.isAuthenticated = User.Identity.IsAuthenticated;
 
-            // Check if the user is an admin
+            // Проверете дали корисникот е администратор или менаџер
             UsersClass customerClass = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin);
+               // ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
+
             ViewBag.hasAccess = customerClass != null;
 
             return View(vetCenters);
         }
+
 
         public async Task<ActionResult> Details(int? id)
@@ -124,6 +139,9 @@
         }
 
-        public async Task<ActionResult> Delete(int? id)
-        {
+        public async Task<ActionResult> Delete(int? id) { 
+             UsersClass customerClass = await checkAuthorizationAsync();
+        
+        ViewBag.isAuthenticated = await getCrrentUser();
+        
             if (id == null)
             {
Index: PostgreSqlDotnetCore/Views/Blog/Edit.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/Blog/Edit.cshtml	(revision 57fc40271dfe03c973365d9799d1dbf2d4360b8f)
+++ PostgreSqlDotnetCore/Views/Blog/Edit.cshtml	(revision 72b1da27c6dadc5f1ae45e91e7c4f60289917575)
@@ -41,5 +41,5 @@
         </div>
     </div>
-    <div class="form-group">
+    @*<div class="form-group">
         @Html.LabelFor(model => model.users_id, htmlAttributes: new { @class = "control-label col-md-2" })
         <div class="col-md-10">
@@ -48,5 +48,5 @@
         </div>
     </div>
-
+    *@
     <div class="form-group">
         <div class="col-md-offset-2 col-md-10">
Index: PostgreSqlDotnetCore/Views/Blog/Index.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/Blog/Index.cshtml	(revision 57fc40271dfe03c973365d9799d1dbf2d4360b8f)
+++ PostgreSqlDotnetCore/Views/Blog/Index.cshtml	(revision 72b1da27c6dadc5f1ae45e91e7c4f60289917575)
@@ -45,9 +45,40 @@
         </th>
 
-        <td>
+       @*<td>
             @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
             @Html.ActionLink("Answers", "Details", new { id = item.id }) |
             @Html.ActionLink("Delete", "Delete", new { id = item.id })
         </td>
+        *@
+           
+
+
+
+              @if (item.users_id == ViewBag.CurrentUserId)
+              {
+              <td>
+            @Html.ActionLink("Edit", "Edit", new { id = item.id }) 
+            @Html.ActionLink("Delete", "Delete", new { id = item.id })
+              
+        </td>
+            }
+
+           
+
+            @if (item.users_id == ViewBag.CurrentUserId || item.users_id != ViewBag.CurrentUserId)
+            {
+                <td>
+                    
+                    @Html.ActionLink("Answers", "Details", new { id = item.id }) 
+                    
+
+                </td>
+            }
+            
+
+
+           
+        
+           
     </tr>
 }
Index: PostgreSqlDotnetCore/Views/Products/Index.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/Products/Index.cshtml	(revision 57fc40271dfe03c973365d9799d1dbf2d4360b8f)
+++ PostgreSqlDotnetCore/Views/Products/Index.cshtml	(revision 72b1da27c6dadc5f1ae45e91e7c4f60289917575)
@@ -98,5 +98,9 @@
                         <div class="col-md-6 col-xs-6">
                             <h3>@item.name</h3>
-                            @if (SignInManager.IsSignedIn(User))
+                            @if (SignInManager.IsSignedIn(User) && ViewBag.hasAccess != null)
+                            // SignInManager.IsSignedIn(User) && ViewBag.hasAccess != null
+                            //SignInManager.IsSignedIn(User) && ViewBag.hasAccess != null && ViewBag.hasAccess == true
+                         
+                                
                             {
                                 <div class="edit-crud-products">
@@ -107,4 +111,6 @@
                             }
                         </div>
+                        
+                       
                         <div class="col-md-6 col-xs-6 price">
                             <h3>
Index: PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml	(revision 57fc40271dfe03c973365d9799d1dbf2d4360b8f)
+++ PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml	(revision 72b1da27c6dadc5f1ae45e91e7c4f60289917575)
@@ -85,5 +85,7 @@
             </td>
 
-            @if (SignInManager.IsSignedIn(User))
+            
+
+         @*   @if ((SignInManager.IsSignedIn(User)))
             {
                 <td>
@@ -95,4 +97,15 @@
                 </td>
             }
+           *@
+
+            @* Додадете условие за проверка на улогите *@
+            @if (SignInManager.IsSignedIn(User) && (ViewBag.hasAccess != null && ViewBag.hasAccess == true))
+            {
+                <td>
+                    @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
+                    @Html.ActionLink("Details", "Details", new { id = item.id }) |
+                    @Html.ActionLink("Delete", "Delete", new { id = item.id })
+                </td>
+            }
 
         </tr>
