Solved

User Rights

Posted on 2006-06-26
1
210 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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