Click here to register.
      
Bazaar


     Etcetera

Group privilege question

User len
Date 8/12/2005 2:51 pm
Views 1973
Rating 27    Rate [
|
]
Previous · Next
User Message
len

I want a page to be visible only if a user is member of group1 AND member of group2.

Does anybody know how to do this ?

Len Kranendonk
www.primaat.com



Back to Top
Rate [
|
]
 
 
len

I want a page to be visible only if a user is member of group1 AND member of group2.

Does anybody know how to do this ?

Len Kranendonk
www.primaat.com



Back to Top
Rate [
|
]
 
 
bottelberghs
That's a nice one Len. I really had to think for a while, and I'm not even sure I have the best solution. My solution would involve an additional group (call it *both_1_and_2*). You can use the scratch filter to dynamically add members to this group. These have to be members that are in both group 1 AND in group 2. You can use the *If* macro to determine if the user is in both groups, and set a scratch variable accordingly.
I haven't tried it yet, but do you think it will work?

-leendert

Back to Top
Rate [
|
]
 
 
len

I'm going to create a new group, "both_A_and_B" use the SQL Query option, which is part of the Group properties.

It will be something like this:

SELECT ^GroupText("groupA",1,0); = 1 AND ^GroupText("groupB",1,0); = 1

This will return 1 if user is in groupA AND in groupB.

Len Kranendonk
www.primaat.com



Back to Top
Rate [
|
]
 
 
bottelberghs
OK, I read about this SQL query option, but never actually understood what it does.
So you perform a query which has a boolean result. Does the user have to be specifically in this group already (assigned by an admin), or does the user automatically become a member of this group if the query result turns out to be true?

-leendert

Back to Top
Rate [
|
]
 
 
len

A user is a member of a group if the SQL query returns boolean 1.
Like IP-based groups, there's no need to pre-assign a user to the group.

You'll have to keep in mind that the getUsersInGroup function won't work on pseudo-groups like IP, Scratch filter or SQL external db groups.
Mailing to a pseudo group is therefore not possible.

Len Kranendonk
www.primaat.com



Back to Top
Rate [
|
]
 
 
nuba
What about creating a group C, containg both group A and B ?

In the 'Manage Groups', in Admin mode, there's a link for 'Groups in this group', near 'Users in this group.'

Back to Top
Rate [
|
]
 
 
len
What about creating a group C, containg both group A and B ?

I want a user to be a member of group C *only* if the user is a member of group A AND group B. With groups in group relation, the groups are OR-ed. So in your suggestion a user is member of group C if he is member of group A OR group B.



Back to Top
Rate [
|
]
 
 
nuba
ooops..

Trying to understand how could I overlook that big AND ?

Sorry

:)

Back to Top
Rate [
|
]
 
 
     Etcetera



Recent Discussions Color Key

Design:

Development:

Et Cetera:

Install/Upgrade:  

Smoketest:

Template Group:


Re: Übersetzungen vor dem nächsten Treffen - Translations to be done before the next meeting will take place. by koen - Mon @ 05:17pm

Übersetzungen vor dem nächsten Treffen by bernd - Mon @ 03:09pm

Re: Auth memcookie by JohnRestrepo - Mon @ 12:57pm

Re: Auth memcookie by JT - Mon @ 11:31am

Auth memcookie by JohnRestrepo - Mon @ 10:40am

Re: Patch for wremonitor by JT - Mon @ 10:36am

Patch for wremonitor by knowmad - Mon @ 10:26am

Re: Synopsis search results by knowmad - Mon @ 10:19am

Synopsis search results by marieken - Mon @ 05:49am

Re: Question concerning approval workflows by preaction - Mon @ 02:05am

Re: Question concerning approval workflows by perlDreamer - Sun @ 08:03pm

Re: Help With Octal Math by perlDreamer - Sun @ 07:43pm