Solved

User Rights

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

724 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