?
Solved

User Rights

Posted on 2006-06-26
1
Medium Priority
?
213 Views
Last Modified: 2010-04-23
I have a Main Form.In that Several Modules Like Entry,Definition There.
In  Definition I have 3 froms.Candidate,Client,Address.

I want to Use 'UerRights'.If Say 'User1' enters, he can see only Some of the forms(CAndidate,Client Only) in Definition and if User2 enters He can Only See (CAndidate,Addrss only). How I will do Such A UserRights
0
Comment
Question by:princyelias
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
ElrondCT earned 240 total points
ID: 16985689
You would have a login form where the user's name is selected. Somewhere separately you need to have a form that assigns user names and which forms that user can access. The login form can load a UserRights class with the information for that user; since variables created in the form will go away when the login form is closed, store the information in another module:

Module Global
    Public CurrentUserRights as UserRights

    Public Class UserRights
        Public blnCandidate as Boolean
        Public blnClient as Boolean
        Public blnAddress as Boolean
    End Class
End Module

In the login form:

    CurrentUserRights.blnCandidate = xxx

where xxx comes from your table indicating which user has which rights.

If your main form has buttons named btnCandidate, btnClient, and btnAddress that open up the additional forms, then you can put something like the following code into the Main form's Load event handler:

    Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        btnCandidate.Enabled = CurrentUserRights.blnCandidate
        btnClient.Enabled = CurrentUserRights.blnClient
        btnAddress.Enabled = CurrentUserRights.blnAddress
    End Sub
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question