Gossamer Forum
Home : Products : DBMan : Customization :

field permission with autogenerate on

Quote Reply
field permission with autogenerate on
Hi, Is there a way to set permission on a field with autogenerate on? I want non-admin users to see and search by a field (Date) but I do not want them to be able to change it. Previous tip on http://www.gossamer-threads.com/...cations/Version_1_x/ didn't help.
Quote Reply
Re: [questiont] field permission with autogenerate on In reply to
(follow up). just noticed that previous posting on similar problem (quoted above) works for text fields, not select ones. It hides the contents of the field during modify. The code is the one below, to be inserted under sub build_html_record_form (default.cfg should also be changed, with field max length as -3). I wonder if that could be adapted to work with select fields? Thanks


elsif ($db_form_len{$field} == -3) { if (($in{'view_search'} == "1") || ($in{'modify_search'} == "1")) { $output .= qq~<tr><td align=right valign=top width=20%><$font>$field:</font></td> <td width=80%><input type=text name="$field" value="$rec{$field}" size="$db_form_len{$field}" maxlength="$db_lengths{$field}"></td></tr>~; } else { $output .= qq~<tr><td align=right valign=top width=20%><input type=hidden name="$field" value="$rec{$field}"><$font>$field:</font></td> <td width=80%>$rec{$field}</td></tr>~; } }
Quote Reply
Re: [questiont] field permission with autogenerate on In reply to
I really think you will find there is much more flexibility if you don't use autogenerate. It's not difficult to setup your database input and output layouts.

JPDeni provides a configurator script on her site which will guide you through creating the html_record_form and html_record subs for you. http://jpdeni.com/dbman/

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/