Home : Products : DBMan SQL : Discussion :

Products: DBMan SQL: Discussion: Re: [mycah] DBman sql template questions: Edit Log

Here is the list of edits for this post
Re: [mycah] DBman sql template questions
In Reply To:
1. Is it possible to set the add modify permissions so they only have access to certain fields in the table? QuoteOr do I need to set up each lvl of membership as a totally different table? If so, how will this affect my searching?


Yes, it is possible to give users limited access to a field. What you need to do is customize your templates. For example, for the add form instead of using the

<%Dbsql::HTML::generate_add_form%>

Create your own add form template (I've attached an example). For example if you create an add form template titled record_add_form.html then you would replace <%Dbsql::HTML::generate_add_form%> with <%include record_add_form.html%>. Make sure to save the add form template with rest of the templates.

Now to limit access to fields simply add a conditional statement. For example, if you have the following field:

<TD vAlign=
top align=right width="135" bordercolor="#003063" bgcolor="#003063" bordercolorlight="#003063" bordercolordark="#003063" height="25"><b><FONT face=Tahoma,Arial,Helvetica

size=
2 color="#FF0000">* </FONT><FONT face=Tahoma,Arial,Helvetica

size=
2 color="#FFFFFF">Case Title:</FONT></b></TD>

To make it such that it only displays when there is a certain user change it to:

<%if user_group_field_name%>

<TD vAlign=top align=right width="135" bordercolor="#003063" bgcolor="#003063" bordercolorlight="#003063" bordercolordark="#003063" height="25"><b><FONT face=Tahoma,Arial,Helvetica

size=
2 color="#FF0000">* </FONT><FONT face=Tahoma,Arial,Helvetica

size=
2 color="#FFFFFF">Case Title:</FONT></b></TD>

<%endif%>

Now this field will only be displayed if the user belongs to that user group.

In Reply To:
2. Is it possible for the program to load a specific display template for a given member? Or in order to provide that do I need to have each member in their own table with their own template set? and if so how will this affect my searching?




Well to display a different add form simply add a conditional statement:

<%if user_type eq 'type1'%>

<%include record_add_form_type1.html%>

<%else%>

<%include record_add_form_type2.html%>

<%endif%>



I'm a novice when it comes to all this stuff, but I hope what little I know actually helps. Also, these are things that I've done, but I'm pretty sure there are other ways to do this. Wink
Reena

Last edited by:

Reena0330: Sep 13, 2002, 1:21 PM

Edit Log: