Question User level security - retrieving group membership

Shefinho

New member
Local time
Today, 22:48
Joined
Apr 29, 2010
Messages
1
I have a database with user-level security and 2 user groups: Read-only Users and Full Data Users (apart from obligatory groups Admins and Users).

I have a program written in C# which uses the database. I would like to retrieve the group membership list for the logged on user. I tried to do it this way:

OleDbCommand cmd = new OleDbCommand("MSysUserMemberships <username>", connection);
cmd.CommandType = CommandType.StoredProcedure;

But I receive an error which says that there is no read permission for MSysUserMembership.

It is impossible to administer the work group info file (.mdw), because the Admin account doesn't have administrative rights, and it is not possible to log on as Engine.

However, when I open the .mdw file in Access, I am allowed to run the MSysUserMemberships query.

Is there maybe a 3rd party hack which removes read prohibition from MSysUserMemberships query?
 
you can use DAO to read the users and groups collections

I cant get at all my code to post it, at present but use something like these

dim wks as workspace
dim usr as user
dim grp as group

set wks = dbengine.workspaces(0)

then you should be able to do things like

for each grp in wks.groups
msgbox grp.name
next

or it might be

set grp = wks.groups("specific group")

the same for USERS collection.

sorry this is a bit cryptic, but I hope this helps
 
For the most secure way to return the users window loginID, see here:

http://www.dbforums.com/6274790-post20.html

The example also shows you how to setup a security level type system. This method has worked regardless of the environment I've been in whereas other methods don't always work or are not as secure.

If you've implemented MSAccess security (ie. an mdw file), you can also use this utility: http://www.dbforums.com/6426828-post91.html

to retrieve all the usernames (and passwords!) in that mdw.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom