Question Control visibility based on data permissions

ewall

New member
Joined
Jun 1, 2009
Messages
3
Location
Portland, Maine, USA
Programming Experience
3-5
Hi, gang! I'm fairly new to VB.NET, but not new to programming. This seems like a busy forum for questions and such, so I'm glad to join in the fun.

Anyway, the question: I have a fairly simple app for changing some database fields (using an ODBCDataSet on .NET 3.5), but the Feature Creep is asking if I can hide or show tabs and other controls based on the user's database permissions. Ideally, I would like to control the permissions only on the server side using AD groups and such, and the app (which uses the logged-in user's Windows account for authentication) would "test" the permissions to determine whether or not to show the tab.

So it's really the last part I need help with: how can I view or test the user's permissions to the dataset? Thanks in advance--
 
You talk about databases and AD; which would you like to use to store your permissions?
 
Sorry for the confusion--I will set the permissions in the SQL Server, based on the Windows authentication from the user's accounts.

So the program should just use the permissions it has to the db... I just don't know if there's a way I can get a listing of the user's rights, or do I have to perform some kind of read/write tests (which seems like a bad idea).
 
So if the user has no privilege to insert or update or delete in the People table, you want to hide the People tab?
 
Exactly.

I assume I can change the visibility of the tab during the form load event.

I'm just not entirely sure how best to test or read the user's database permissions. I suppose I could try to load the dataset and catch the exception if the user has no "read" rights. But I would rather not try to do a "write" if I can help it; hoping there's a way to just check the permissions first...
 
[ame=http://www.google.co.uk/search?sourceid=navclient&ie=UTF-8&rls=GGLJ,GGLJ:2008-53,GGLJ:en&q=sqlserver+list+user+permissions]sqlserver list user permissions - Google Search[/ame]

Knock yourself out! :)
 
Back
Top