         [:th "Received Date "]
         ]]
       [:tbody
-       (for [mt mutations]
-         ^{:key (.-id mt)} [:tr
-                            [:td [:a {:href "javascript:;" :on-click  #(click-update (.-id mt))  :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]]
-                            [:td  [:a {:href "javascript:;" :on-click #(delete(.-id mt))  :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}] ]
-                            [:td (.-mutationnumber (.-numbers mt))]
-                            [:td (.-nameofthefirstparty mt)]
-                            [:td (.-nameofthesecondparty mt)]
-                            [:td (.-dateofinstitution mt)]
-                            [:td (.-nameofpo mt)]
-                            [:td (.-name (.-district  mt))]
-                            [:td (.-name (.-subdivision mt))]
-                            [:td (.-name (.-village mt))]
-                            [:td (.-o2number (.-numbers  mt))]
-                            [:td (.-o4number (.-numbers mt))]
-                            [:td (.-o6number (.-numbers mt))]
-                            [:td (.-senddate mt)]
-                            [:td (.-receiveddate mt)]
-                            ])]]
+       (doall (for [mt mutations]
+                ^{:key (.-id mt)} [:tr
+                                   (when (is-admin-or-super-admin)[:td [:a {:href "javascript:;" :on-click  #(click-update (.-id mt))  :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]])
+                                   (when (is-admin-or-super-admin)[:td  [:a {:href "javascript:;" :on-click #(delete(.-id mt))  :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}] ])
+                                   [:td (.-mutationnumber (.-numbers mt))]
+                                   [:td (.-nameofthefirstparty mt)]
+                                   [:td (.-nameofthesecondparty mt)]
+                                   [:td (.-dateofinstitution mt)]
+                                   [:td (.-nameofpo mt)]
+                                   [:td (.-name (.-district  mt))]
+                                   [:td (.-name (.-subdivision mt))]
+                                   [:td (.-name (.-village mt))]
+                                   [:td (.-o2number (.-numbers  mt))]
+                                   [:td (.-o4number (.-numbers mt))]
+                                   [:td (.-o6number (.-numbers mt))]
+                                   [:td (.-senddate mt)]
+                                   [:td (.-receiveddate mt)]
+                                   ]))]]
      [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]])
 
 

(defn main
  []
  (secretary/set-config! :prefix "#")
  (set-key-value :page-location [render-mutations])
  (r/render [page]
            (.getElementById js/document "app1"))
  (let [history (History.)]


(defn is-authenticated? []
  (not (nil? (get-value! :user))))

(defn is-admin-or-super-admin []
  (let [role (.-role (get-value! :user))]
    (or (= role "admin")
        (= role "superadmin"))))

(defn set-page! [currnt-page]
  (if (nil? (get-value! :user)) (set-key-value :page-location [login])
