Index: openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/citybuild/Attic/object-edit.tcl,v diff -u -N -r1.13 -r1.14 --- openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl 12 Jan 2004 16:04:22 -0000 1.13 +++ openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl 16 Jan 2004 16:03:44 -0000 1.14 @@ -132,9 +132,12 @@ is_located_in { label "Located inside (optional)" } - } - + attributes { + on_map_p { + write_privileges "sim_set_map_p" + } + } } sim_prop { content_method richtext @@ -158,6 +161,11 @@ label "Letterhead" } } + attributes { + on_map_p { + write_privileges "sim_set_map_p" + } + } } sim_stylesheet { content_method textarea @@ -400,6 +408,12 @@ -property widget \ -default $form_widget($datatype)] + set elm_write_privileges [get_metadata_property \ + -content_type $content_type \ + -entry_type attributes \ + -entry $attribute_name \ + -property write_privileges \ + -default {}] set elm_required_p [get_metadata_property \ -content_type $content_type \ -entry_type attributes \ @@ -415,6 +429,20 @@ lappend extra { options \$options } } + if { [llength $elm_write_privileges] > 0 } { + set mode display + foreach privilege $elm_write_privileges { + # HACK: we only check permission on the package + if { [permission::permission_p -object_id [ad_conn package_id] -privilege $privilege] } { + set mode edit + break + } + } + if { [string equal $mode "display"] } { + lappend extra { mode display } + } + } + set elm_decl "${elm_name}:${elm_datatype}($elm_widget)" if { !$elm_required_p } { append elm_decl ",optional"