Index: PostgreSqlDotnetCore/Controllers/PetsController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/PetsController.cs	(revision a3ce071e97bad04f989c769589a31427febe9ff3)
+++ PostgreSqlDotnetCore/Controllers/PetsController.cs	(revision 2aea0fddc0f6d0c25f0d44044eeb2ec5930012b9)
@@ -19,18 +19,12 @@
             // check for permission
             UsersClass customerClass = await getCrrentUser();
-
-            // set if is authenticated
-            ViewBag.isAuthenticated = customerClass;
             if (customerClass == null)
             {
                 return RedirectToAction("AccessDenied", "Error");
             }
-            // no access for standard user
-            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
-
             if (customerClass.role_id == RoleConstants.Standard)
             {
-                // filter user pets by UserID
-                var query = from st in db.PetsObj
+                // kco
+                            var query = from st in db.PetsObj
                             where st.usersid == customerClass.id
                             select st;
@@ -40,6 +34,5 @@
                     await query.ToListAsync<PetsClass>();
                 return View(userPets);
-            }
-            else
+            } else
             {
                 return View(db.PetsObj.ToList());
@@ -49,95 +42,5 @@
 
         // GET: Customer/Details/5
-        /* public ActionResult Details(int? id)
-         {
-             if (id == null)
-             {
-                 return RedirectToAction("NotExist", "Error");
-             }
-             PetsClass peClass = db.PetsObj.Find(id);
-             if (peClass == null)
-             {
-                 return RedirectToAction("NotExist", "Error");
-             }
-             return View(peClass);
-         }*/
-
-        public async Task<ActionResult> Details(int? id)
-        {
-            if (id == null)
-            {
-                return RedirectToAction("NotExist", "Error");
-            }
-
-            UsersClass customerClass = await getCrrentUser(); // Добијте ја тековната улога на корисникот
-            ViewBag.isAuthenticated = customerClass;
-
-            PetsClass peClass = await db.PetsObj.FindAsync(id);
-            if (peClass == null)
-            {
-                return RedirectToAction("NotExist", "Error");
-            }
-            // no access for standard user
-            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
-
-
-            return View(peClass);
-        }
-
-        // GET: Customer/Create
-        //public ActionResult Create()
-        //{
-        //    return View();
-        //}
-
-        public async Task<ActionResult> CreateAsync()
-        {
-
-            // check for permission
-            UsersClass customerClass = await getCrrentUser();
-            // set if is authenticated
-            ViewBag.isAuthenticated = customerClass;
-            return View();
-        }
-
-        // POST: Customer/Create
-        // To protect from overposting attacks, enable the specific properties you want to bind to, for 
-        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
-        [HttpPost]
-        [ValidateAntiForgeryToken]
-        public async Task<ActionResult> CreateAsync([Bind(include: "id,name,color,description,dateofbirthday, usersid,typeofpetsid")] PetsClass peClass)
-        {
-            bool isAuthenticated = User.Identity.IsAuthenticated;
-            if (!isAuthenticated)
-            {
-                // set if is authenticated
-                ViewBag.isAuthenticated = null;
-                return RedirectToAction("AccessDenied", "Error");
-            }
-            ViewBag.isAuthenticated = new UsersClass();
-            // no access for standard user
-            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
-
-            if (ModelState.IsValid)
-            {
-                // set if is authenticated
-                ViewBag.isAuthenticated = new UsersClass();
-                // peClass.dateofbirthday = DateTime.SpecifyKind(peClass.dateofbirthday, DateTimeKind.Utc);
-                var user = await _userManager.GetUserAsync(User);
-                var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
-                peClass.usersid = customerClass.id;
-                // voa go pisav tuka na 18.02
-                // PetsClass.dateofbirthday = DateOnly.FromDateTime(DateTime.UtcNow);
-                db.PetsObj.Add(peClass);
-                db.SaveChanges();
-                return RedirectToAction("Index");
-            }
-
-            return View(peClass);
-        }
-
-        // GET: Customer/Edit/5
-        // public ActionResult Edit(int? id)
-        public async Task<ActionResult> Edit(int? id)
+        public ActionResult Details(int? id)
         {
             if (id == null)
@@ -150,9 +53,59 @@
                 return RedirectToAction("NotExist", "Error");
             }
-            // додадено на 21.08
-            ViewBag.isAuthenticated = await getCrrentUser();
-            // no access for standard user
-            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
+            return View(peClass);
+        }
 
+        // GET: Customer/Create
+        //public ActionResult Create()
+        //{
+        //    return View();
+        //}
+
+        public ActionResult Create()
+        {
+            
+            return View();
+        }
+
+        // POST: Customer/Create
+        // To protect from overposting attacks, enable the specific properties you want to bind to, for 
+        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public async Task<ActionResult> CreateAsync([Bind(include: "id,color,description,dateofbirthday, usersid,typeofpetsid")] PetsClass peClass)
+        {
+            bool isAuthenticated = User.Identity.IsAuthenticated;
+            if (!isAuthenticated)
+            {
+                return RedirectToAction("AccessDenied", "Error");
+            }
+            if (ModelState.IsValid)
+            {
+               // peClass.dateofbirthday = DateTime.SpecifyKind(peClass.dateofbirthday, DateTimeKind.Utc);
+                var user = await _userManager.GetUserAsync(User);
+                var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
+                peClass.usersid = customerClass.id;
+                // voa go pisav tuka na 18.02
+               // PetsClass.dateofbirthday = DateOnly.FromDateTime(DateTime.UtcNow);
+                db.PetsObj.Add(peClass);
+                db.SaveChanges();
+                return RedirectToAction("Index");
+            }
+
+            return View(peClass);
+        }
+
+        // GET: Customer/Edit/5
+        public ActionResult Edit(int? id)
+        {
+            if (id == null)
+            {
+                return RedirectToAction("NotExist", "Error");
+            }
+            PetsClass peClass = db.PetsObj.Find(id);
+            if (peClass == null)
+            {
+                return RedirectToAction("NotExist", "Error");
+            }
             return View(peClass);
         }
@@ -163,28 +116,16 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public async Task<ActionResult> EditAsync([Bind(include: "id,name, color,description,dateofbirthday, usersid,typeofpetsid")] PetsClass peClass)
+        public async Task<ActionResult> EditAsync([Bind(include: "id,color,description,dateofbirthday, usersid,typeofpetsid")] PetsClass peClass)
         {
             bool isAuthenticated = User.Identity.IsAuthenticated;
-            ViewBag.isAuthenticated = await getCrrentUser();
-
             if (!isAuthenticated)
             {
-                // set if is authenticated
-                ViewBag.isAuthenticated = null;
                 return RedirectToAction("AccessDenied", "Error");
             }
-
-            // set if is authenticated
-            // додадено и избришено
-            ViewBag.isAuthenticated = await getCrrentUser();
-            //ViewBag.isAuthenticated = new UsersClass();
-            // no access for standard user
-            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
-
-
+             
             if (ModelState.IsValid)
             {
                 //peClass.dateofbirthday = DateTime.SpecifyKind(peClass.dateofbirthday, DateTimeKind.Utc);
-
+                
                 var user = await _userManager.GetUserAsync(User);
                 var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
@@ -198,19 +139,5 @@
 
         // GET: Customer/Delete/5
-        /* public ActionResult Delete(int? id)
-         {
-             if (id == null)
-             {
-                 return RedirectToAction("NotExist", "Error");
-             }
-             PetsClass peClass = db.PetsObj.Find(id);
-             if (peClass == null)
-             {
-                 return RedirectToAction("NotExist", "Error");
-             }
-             return View(peClass);
-         }*/
-
-        public async Task<ActionResult> Delete(int? id)
+        public ActionResult Delete(int? id)
         {
             if (id == null)
@@ -218,17 +145,9 @@
                 return RedirectToAction("NotExist", "Error");
             }
-
-            UsersClass customerClass = await getCrrentUser(); // Добијте ја тековната улога на корисникот
-            ViewBag.isAuthenticated = customerClass;
-
-            PetsClass peClass = await db.PetsObj.FindAsync(id);
+            PetsClass peClass = db.PetsObj.Find(id);
             if (peClass == null)
             {
                 return RedirectToAction("NotExist", "Error");
             }
-            // no access for standard user
-            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
-
-
             return View(peClass);
         }
