diff --git a/frontend/src/app/main/ui/workspace/main_menu.cljs b/frontend/src/app/main/ui/workspace/main_menu.cljs index d75c75b57..7fd4cddb5 100644 --- a/frontend/src/app/main/ui/workspace/main_menu.cljs +++ b/frontend/src/app/main/ui/workspace/main_menu.cljs @@ -479,7 +479,7 @@ (mf/defc file-menu* {::mf/props :obj ::mf/private true} - [{:keys [on-close file can-edit]}] + [{:keys [on-close file]}] (let [file-id (:id file) shared? (:is-shared file) @@ -487,6 +487,9 @@ frames (->> (cfh/get-immediate-children objects uuid/zero) (filterv cfh/frame-shape?)) + perms (mf/use-ctx ctx/team-permissions) + can-edit (:can-edit perms) + on-remove-shared (mf/use-fn (mf/deps file-id) @@ -567,11 +570,12 @@ :on-close on-close} (if ^boolean shared? - [:> dropdown-menu-item* {:class (stl/css :submenu-item) - :on-click on-remove-shared - :on-key-down on-remove-shared-key-down - :id "file-menu-remove-shared"} - [:span {:class (stl/css :item-name)} (tr "dashboard.unpublish-shared")]] + (when can-edit + [:> dropdown-menu-item* {:class (stl/css :submenu-item) + :on-click on-remove-shared + :on-key-down on-remove-shared-key-down + :id "file-menu-remove-shared"} + [:span {:class (stl/css :item-name)} (tr "dashboard.unpublish-shared")]]) (when can-edit [:> dropdown-menu-item* {:class (stl/css :submenu-item)