How do I get the active group for the active user

L

Lois

I'm in Access 2002 (XP) and I use CurrentUser() to get the current user.
However I need to activate a toolbar according to the group that is active.
How do I do this.
 
R

Rick B

A user will almost always be a member of more than one group. You can test
to see if they are in a particular group. There is a function you would
have to build.

Do a search and read the previous posts related to "IsUserInGroup" or
"IsInGroup". I can't remember which is the appropriate name.
 
L

Lois

The problem is that I loop through all the groups but this does not assure me
that if the user is assigned to two groups that the active group is the one
that is listed. In fact that is my problem. How can I test the active group
with the value in the loop for the current user. I can find the active
group when using DAO but not in ADO . Any other suggestions?
 
R

Rick B

What do you mean ACTIVE GROUP? If my UserID is part of two groups (users
and admins) there is no ACTIVE group. I am a member of both groups at any
given time.
 
C

Chris Mills

"Active Group" is not a valid term.

You could say no groups are active.
You could equally say all groups are active.
You cannot say one group is active over another.

The only thing that's "active" is CurrentUser(), and they inherit all the
permissions, cumulatively, of all the groups they belong to.

How can you tell an "active group" with DAO, and what makes you think there
is?

Perhaps if you posted what exactly you were trying to achieve...we simply
don't know what you mean.

(also, it's got to be some special security issue, to even want to go through
the groups in code. In one db I do do it, to find in code if the user has
permission for something. But I step through (the user) and then all the
groups they belong to, to see if they have a particular permission. When they
do, no need to check further. The order of groups is probably alphabetical for
all I know, so nothing can be gleaned from which group I found the permissions
in first)

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top