Gossamer Forum
Home : Products : DBMan : Customization :

Set permission on field ?

Quote Reply
Set permission on field ?
Hi all,

I'm searching for a possibility to set permissions on a single field of a record.
The user who's accessing dbman should be able to add content in a specitfic field, but he shouldn't have the access to make modifications on existing content of a record.

E.g.: The Record is
1;First Field;Second Field;;
Now he should be able to add content in "Third Field" but he shouldn't have the access to make modifications on the field "1;First Field;Second Field"

Any ideas ?
Regards,
KW
Quote Reply
Re: [KW] Set permission on field ? In reply to
Are you using Auto-generate, or have you customized the html.pl file?

Who *would* be able to modify the record? Admin? Perhaps the record "owner".

It's possible to do what you want, but a little more info is needed. What is it that you are trying to do?
Quote Reply
Re: [Watts] Set permission on field ? In reply to
Hi,

regarding your questions:
- No I'm not using autogenerate
- only the Admin should be able to make needed modifications on existing content.
- the hlm.pl file is mainly the "Instant modification/deletion of search results, revamped display" mod with some minor modifications from me.

I need to schedule a user training with lot's of people in small groups -> lot of training dates. Therefore the interested User should register himself to a training date (modify an existing record), but he should not be able to modfiy/delete field content from other, already registered Users. He should also not be able to modify the ID field and the field for the training date.
These are the field definitions:
ID => [0, 'numer', 5, 8, 1, '', ''],
'Training Date' => [1, 'alpha',40, 255, 1, '', ''],
'Participant 1' => [2, 'alpha',40, 255, 0, '', ''],
'Participant 2' => [3, 'alpha',40, 255, 0, '', ''],
'Participant 3' => [4, 'alpha',40, 255, 0, '', ''],
'Participant 4' => [5, 'alpha',40, 255, 0, '', ''],
'Participant 5' => [6, 'alpha',40, 255, 0, '', ''],

Thankx
Quote Reply
Re: [KW] Set permission on field ? In reply to
I suppose you could "wrap" the form field in an if statement that evaluated the participant field to see if anyone has taken the time slot, then if someone has, it becomes read only. However, this would not allow the user who signed-up for the time slot to remove themselves (admin only).

Also it does not prevent someone from making changes to a participant field if they have a good understanding of html forms and can submit a modify_record string manually.
Quote Reply
Re: [KW] Set permission on field ? In reply to
It's probably kinda late now, but the "relational db MOD" is going to be exactly what you need. You can have a db of classes and a db of people and then the people can select from list of classes, and then you can select a class and get everyone who is registered for that class.
Quote Reply
Re: [Watts] Set permission on field ? In reply to
I already made it, but nevertheless THANKX.

I created the following if statement within the html_record_form which does the things I wanna to have. I did this for every field which should be handelt in this way.

if ( $rec{'Participant 1'} eq "") # Is the field empty ??
{
print qq| <TR><TD ALIGN="Right" VALIGN="TOP">1.Participant/Dept./Phone:</TD>
<TD VALIGN="TOP">&nbsp;<INPUT TYPE="TEXT" NAME="Participant 1" VALUE="$rec{'Participant 1'}" SIZE="40" MAXLENGTH="40"></TD></TR>
|;
} else {
print qq| <TR><TD ALIGN="Right" VALIGN="TOP">1.Participant/Dept./Phone:</TD>
<TD>&nbsp;$rec{'Participant 1'}</TD></TR><INPUT TYPE=hidden NAME="Participant 1" VALUE="$rec{'Participant 1'}">
|;
}