Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restricting access to methods

Status
Not open for further replies.

apc2003

Programmer
Aug 29, 2003
54
GB
I have a problem with restricting access to methods within my application. I am trying to restrict access to specified windows user groups but MUST ALLOW the client to have the ability to change which user groups can access what.

Example: One day the manager may wish the accounts team to be able to access one thing and the next day he may wish them to be restricted.

I have been testing code using:

1. WindowsPrincipals
2. PrincipalPermission

but am having little luck.

Can anyone help?

Regards in advance...
 
Your methods in your application at the end are called as the result of user action e.g the user press a key, select an menu item , press a button , queries a specific record set etc...
The solution is to have user/usergroups/roles/profiles/rights stored outside of your application in a database and your apllications will go there first, will retrieve the application information (e.g. which window/menu items/buttons this user is not allowed to access) and before the window is visible your code will disable/hide the corresponding menu items, buttons etc...
The manager only will changes the roles/profiles/rights only. For this approach, you have to find a way to identify uniquely all those menu items/ buttons etc... for each window , have that stored in the database at the rights level.

-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top