From 069d49afbaee287732288f444e7d4be51475b13f Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 2 Nov 2017 09:43:08 -0600 Subject: [PATCH] Disable copy / paste for readonly shares --- api/src/Vfs/Sharing.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/api/src/Vfs/Sharing.php b/api/src/Vfs/Sharing.php index e1dbae1dbf..9d89fd73b1 100644 --- a/api/src/Vfs/Sharing.php +++ b/api/src/Vfs/Sharing.php @@ -683,5 +683,38 @@ if (file_exists(__DIR__.'/../../../filemanager/inc/class.filemanager_ui.inc.php' { return $GLOBALS['egw']->sharing->get_root(); } + + /** + * Context menu + * + * @return array + */ + public static function get_actions() + { + $actions = parent::get_actions(); + $group = 1; + if(Vfs::is_writable($GLOBALS['egw']->sharing->get_root())) + { + return $actions; + } + $actions+= array( + 'egw_copy' => array( + 'enabled' => false, + 'group' => $group + 0.5, + 'hideOnDisabled' => true + ), + 'egw_copy_add' => array( + 'enabled' => false, + 'group' => $group + 0.5, + 'hideOnDisabled' => true + ), + 'paste' => array( + 'enabled' => false, + 'group' => $group + 0.5, + 'hideOnDisabled' => true + ), + ); + return $actions; + } } } \ No newline at end of file