Index: openacs-4/packages/file-storage/www/file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file.tcl,v diff -u -N -r1.35.2.6 -r1.35.2.7 --- openacs-4/packages/file-storage/www/file.tcl 25 Apr 2017 18:08:26 -0000 1.35.2.6 +++ openacs-4/packages/file-storage/www/file.tcl 3 May 2017 18:18:15 -0000 1.35.2.7 @@ -38,6 +38,7 @@ # get folder id so we can implement a back link set folder_id [db_string get_folder {}] +set folder_write_p [permission::permission_p -object_id $folder_id -privilege write] set folder_view_url [export_vars -base index {folder_id}] @@ -73,8 +74,10 @@ "Rename file" } -# add button only when available folders for copy exist -if {[db_list_of_lists dbqd.file-storage.www.copy.get_folder_tree {}] ne ""} { +# add button only when available folders for copy exist. We settle for +# a lazy check on write permissions for folder because a rigorous +# check of available destinations would not be performant. +if {$folder_write_p} { lappend actions \ [_ file-storage.Copy_File] \ [export_vars -base copy {{object_id $file_id} return_url}] \ Index: openacs-4/packages/file-storage/www/folder-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.tcl,v diff -u -N -r1.49.2.8 -r1.49.2.9 --- openacs-4/packages/file-storage/www/folder-chunk.tcl 25 Apr 2017 18:08:26 -0000 1.49.2.8 +++ openacs-4/packages/file-storage/www/folder-chunk.tcl 3 May 2017 18:18:15 -0000 1.49.2.9 @@ -200,6 +200,8 @@ where parent_id = :folder_id and acs_permission__permission_p(object_id, :viewing_user_id, 'delete')) }] + set bulk_copy_p [permission::permission_p -object_id $folder_id -privilege write] + # add button only when available folders for move exist. We # lazily check for deletion, as a proper check of a suitable @@ -208,8 +210,10 @@ lappend bulk_actions \ [_ file-storage.Move] ${fs_url}move [_ file-storage.lt_Move_Checked_Items_to] } - # add button only when available folders for copy exist - if {[db_list_of_lists dbqd.file-storage.www.copy.get_folder_tree {}] ne ""} { + # add button only when available folders for copy exist. We settle for + # a lazy check on write permissions for folder because a rigorous + # check of available destinations would not be performant. + if {$bulk_copy_p} { lappend bulk_actions \ [_ file-storage.Copy] ${fs_url}copy [_ file-storage.lt_Copy_Checked_Items_to] }