Solved

User Rights

Posted on 2006-06-26
1
208 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
1 Comment
 
LVL 20

Accepted Solution

by:
ElrondCT earned 80 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 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