Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password on menu

Status
Not open for further replies.

mannah07

IS-IT--Management
Dec 23, 2003
18
DE
I have a application deployed on a server. Now I want to password a menu item so that only certain user can have access to that menu item. Is there a way out for this pls?.
 
mannah07

Create a method/UDF called .mValidateUser or similar in your main.prg or other suitable form/object.

In the Skip For: option of the relevant menu option put :-
Code:
[COLOR=blue]oMain.mValidateUser()[/color]
write the method/UDF in such a way that if a certain user is running the app, you have
Code:
[COLOR=blue]RETURN .F.[/color]
otherwise
Code:
[COLOR=blue]RETURN .T.[/color]


FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommandertm.com
PDFcommandertm.co.uk


 
mannah07

Just in case you're not familiar with Skip For, if the expression being evaluated returns .T., the menu option will be disabled.

So in your method/UDF you could code something similar to
Code:
[COLOR=blue]DO CASE
CASE UPPE(ALLT(USERS.username)) = [FRED BLOGGS]
[tab]RETURN .F.
CASE UPPE(ALLT(USERS.username)) = [SAM SMITH]
[tab]RETURN .T.
ENDC[/color]

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommandertm.com
PDFcommandertm.co.uk


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top