Hi Everybody,

I have a desktop application designed (VB.NET 2008 and SQL2005) which consists of user login and some access level for the users.

The user class which i have classified are :

1. Administrator
2. Operator
3. Report User

This user has got a few access in my application. I have got stuck how to create a user class and give access level for this class and map those class to the users.

Please HELP!!!!!!!!

I think you should go with interfaces. Have a look at this code-snippet.

public interface IUser {
    void Show();
}
public interface IOperator : IUser{
    void Add();
}
public interface IAdmin  : IOperator{
    void Edit();
    void Delete();
}

public class YourClassApp : IAdmin
{
   ....
}
Public Interface IUser
    Sub Show()
End Interface
Public Interface IOperator
    Inherits IUser
    Sub Add()
End Interface
Public Interface IAdmin
    Inherits IOperator
    Sub Edit()
    Sub Delete()
End Interface

Public Class YourClassApp
    Implements IAdmin
    ......
End Class

Edited 6 Years Ago by __avd: n/a

NEED SOME MORE ELABORATION PLEASE.... i would be much more thankful if could provide me some example.

Hi tashiDuks.

Oh! I'm sorry (; Can you maybe provide some more information about what it is you are trying to do?

Edited 6 Years Ago by __avd: n/a

Well i have a application with a different user class, i.e Admins, Operator, Report User, and so on... where each user class will have different access to the forms. I have a Menus. For example if the user logs in with the user class report user can use only the report menu and rest menu items will be disabled. Likewise if the user logs in using user class Operator, i will be accessable only for reporting and doing the transcation and the admin menu will be disabled.

In short i want to enable and disable menu items as per the user class.

I hope you have got what i mean to say and what i want. Can you please help me out.

This article has been dead for over six months. Start a new discussion instead.