Sanjay Singh
|
| Posted: 03/26/2002, 11:39 AM |
|
I have downloaded CodeCharge (trial version) to see if it is suitable for a
project I am working on. I have worked with ASP (Visual Interdev) on a few
projects and would like to use CodeCharge instead as it seems like a great
RAD tool.
Basic Specs (and questions) for my new application are:
Users will be assigned to security levels that will decide what pages that
they will have access to. Is there an easy way to only show links to the
pages that the user has access to after they login. I would prefer this to
them getting a "You do not have sufficient access to this screen" msg.
User will also belong to different "workshops". When they look at a page
(say a grid), they should only see vehicles that belong to their workshop.
Is there any easy way to do this from within the CC interface.
Does CC generate Javascript code to do client sode validation?
Thanks in advance
Sanjay
|
|
|
 |
CodeCharge Support
|
| Posted: 03/26/2002, 2:16 PM |
|
Hello,
Setting up the links the way you described requires some familiarity with
CodeCharge.
I can recommend a solution that would work only if you generate ASP &
Templates:
First, please take a look at this article: http://www.gotocode.com/art.asp?art_id=54
This article shows how you can use "SetVar" function to hide specific forms
on the page.
SetVar function also can be used to replace specially marked content on the
page (in curly {brackets} ) with something else.
For example, you can place special {tag} on your page, like {my_tag}, then
programmatically replace it with a calculated value.
In your case, I recommend that you create menu options and name them by
setting field captions to :
{menuoption1}
{menuoption2}
{menuoption3}
Then in the Form's Open event, enter some code that would check user's
permissions and activate those menu options accordingly.
For example:
if Session("UserRights") =1 then
SetVar "menuoption1","Menu Option 1"
SetVar "menuoption2","Menu Option 2"
end if
"UserRights" is the standard session variable used by CodeCharge programs,
which contains Security Level of the current user.
Another method could to manually create your menu in HTML and place such
HTML in Page or Form Header (in CodeCharge Page/Form properties).
But replace actual menu options with the abovementioned bracketed tags, like
{menuoptionX}
Then in the Page's or Form's Open event, enter some code that would check
user's permissions and activate those menu options accordingly.
For example:
if Session("UserRights") =1 then
SetVar "menuoption1","<a href=""page1.asp"">Menu Option 1</a>"
end if
Regarding the grid/workshop, yes you can filter the Grid by entering Where
criteria in Grid Properties, or by setting up Input parameters, or by
programmatically manipulating sWhere variable in Form's Open Event.
For example in Open Event:
sWhere = sWhere & " AND workshop_id=" &
DLookup("users","workshop_id","user_id=" & Session("UserID"))
CC doesn't generate JavaScript, but you can place JavaScript in Page/Form
Header/Footer section.
Please contact our support at http://support.codecharge.com if replying.
Adam
"Sanjay Singh" <sanjays@standss.com.fj> wrote in message
news:a7qiq3$cbh$1@news.codecharge.com...
> I have downloaded CodeCharge (trial version) to see if it is suitable for
a
> project I am working on. I have worked with ASP (Visual Interdev) on a few
> projects and would like to use CodeCharge instead as it seems like a great
> RAD tool.
>
> Basic Specs (and questions) for my new application are:
>
> Users will be assigned to security levels that will decide what pages that
> they will have access to. Is there an easy way to only show links to the
> pages that the user has access to after they login. I would prefer this to
> them getting a "You do not have sufficient access to this screen" msg.
>
> User will also belong to different "workshops". When they look at a page
> (say a grid), they should only see vehicles that belong to their workshop.
> Is there any easy way to do this from within the CC interface.
>
> Does CC generate Javascript code to do client sode validation?
>
> Thanks in advance
> Sanjay
>
>
>
>
|
|
|
 |
Anthony Niemann
|
| Posted: 03/28/2002, 3:55 PM |
|
> Users will be assigned to security levels that will decide what pages that
> they will have access to. Is there an easy way to only show links to the
> pages that the user has access to after they login. I would prefer this to
> them getting a "You do not have sufficient access to this screen" msg.
Another solution to the menu issue would be to have the menu be table
driven. In the table store the access level required for that menu item.
Then in the SQL select statement use a WHERE clause that references the
Session("UserRights").
This could be preferable to Adam's solution in that you wouldn't need to
know how many items there were going to be ahead of time.
The GotoCode sample projects page uses a table to build the side menu with
the table also providing the references to the images as well.
HTH,
Tony
|
|
|
 |
|