Solved

User Rights

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VB.net Excel Add-in TaskPane not opening 3 46
.net VBA word safemode 1 24
Crystal Report for VS2013 17 40
VB.NET HttpWebRequest 12 30
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now