Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Prasant T
  Where is Prasant T?
 Thrissur, Kerala
 India
 Prasant T
 Tags
Subject: RE: Deny Access in some Menu items
Thread ID: 200698 Message ID: 200852 # Views: 49 # Ratings: 0
Version: Visual FoxPro 9 Category: Menus
Date: Thursday, October 30, 2008 7:13:05 AM         
   


> Hi,
>
> I have developed a Menu using create menu. It is working fine. I want to block some users from accessing some items of menu.
>
> for example:
>
> Main Menu
> .....Pay Roll
> ..........Employee Master
> ..........Salary Preparation
> ..........Bonus Calculation
> ..........Attendance Entry
> ..........------------------
> ------
>
> There are two users. Admin & User. I want to block Bonus calculation to User. Is there any way? How I can use SKIP FOR in this condition?
>
>
> Prasant

Normally, when you create a table to hold the allowed users, it is something like this:

Login.Dbf Structure
LoginName      c(10)  && A nickname for easy login
Password       c(10)  && The encrypted password
FullName       c(40)  && The complete name of the user
JobPos         c(40)  && Job Position
IsAdmin        L      && Logical True or False, True as Admin, False as Plain Users


Now in your module where you grant users an access to your app, you immediately decide on the level of that specific user. The simplest is creating two levels as shown above which can be achieved by a logical field. So you can save a specific user as an Admin or not. Then when your user login successfuly, you can immediately get the access level and place the value in a _Screen variable like this:

_Screen.AddObject("oIsAdmin",login.isadmin)

So on your menu item, you can now SKIP FOR !_screen.Isadmin

Jun Tangunan
http://weblogs.foxite.com/sandstorm36/



COMPLETE THREAD
Deny Access in some Menu items Posted by Prasant T @ 10/29/2008 1:49:34 PM
RE: Deny Access in some Menu items Posted by surinder singh @ 10/29/2008 1:52:52 PM
RE: Deny Access in some Menu items Posted by tushar @ 10/29/2008 1:54:31 PM
RE: Deny Access in some Menu items Posted by Benny Thomas @ 10/31/2008 10:04:30 AM
RE: Deny Access in some Menu items Posted by tushar @ 10/31/2008 11:41:06 AM
RE: Deny Access in some Menu items Posted by Yousfi Benameur @ 10/29/2008 2:09:58 PM
RE: Deny Access in some Menu items Posted by Jun Tangunan @ 10/30/2008 7:13:05 AM
RE: Deny Access in some Menu items Posted by Rafael Escambion @ 10/30/2008 7:47:23 AM
RE: Deny Access in some Menu items Posted by Stefan Wuebbe @ 10/30/2008 6:41:11 PM
RE: Deny Access in some Menu items Posted by Glenn Villar @ 10/31/2008 2:03:23 AM
RE: Deny Access in some Menu items Posted by Stefan Wuebbe @ 10/31/2008 8:54:37 AM
RE: Deny Access in some Menu items Posted by Marcia Akins @ 11/1/2008 12:40:31 PM
RE: Deny Access in some Menu items Posted by Prasant T @ 11/3/2008 8:21:35 AM
RE: Deny Access in some Menu items Posted by Biju Thomas @ 12/3/2008 4:38:27 AM