Index: openacs-4/packages/file-storage/www/simple-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/simple-add-2.tcl,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/packages/file-storage/www/simple-add-2.tcl 20 Mar 2003 22:14:12 -0000 1.2.2.1 +++ openacs-4/packages/file-storage/www/simple-add-2.tcl 2 May 2003 14:30:48 -0000 1.2.2.2 @@ -18,9 +18,20 @@ } +set user_id [ad_conn user_id] + # Check for write permission on this folder ad_require_permission $folder_id write -content_extlink::new -url $url -label $title -description $description -parent_id $folder_id +set item_id [content_extlink::new -url $url -label $title -description $description -parent_id $folder_id] +# Analogous as for files (see file-add-2) we know the user has write permission to this folder, +# but they may not have admin privileges. +# They should always be able to admin their own url (item) by default, so they can delete it, control +# who can read it, etc. + +if { [string is false [permission::permission_p -party_id $user_id -object_id $folder_id -privilege admin]] } { + permission::grant -party_id $user_id -object_id $item_id -privilege admin +} + ad_returnredirect "?folder_id=$folder_id"