NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use
trunk.foswiki.org to view this page for some minimal testing.
Use
Item9693 for docu changes for 1.2 and 2.0.
Item11606: Documentation 'ifStatements ==> ingroup-Function'
| Priority: |
CurrentState: |
AppliesTo: |
Component: |
WaitingFor: |
| Low |
Closed |
Engine |
Documentation |
|
We worked with the ingroup function of the if-statements. For that, we used the Foswiki documentation.
We think it is a bit confusing because in the definition of the function, there is the keyword $USER, which doesn't work.
We thought, $USER is the keyword for the current user.
BUt in the example straight below you use the correct keyword $USERNAME.
Link to documentation:
http://foswiki.org/System/IfStatements#Group_membership
--
SimonRissi - 05 Mar 2012
I think what Crawford was trying to do, was show a 'generalised use case' and then a specific example. I've add a little more text and replaced
$USER with
$SOMEONE
I hope that helps
Group membership
To test if SOMEONE is in the GROUP:
%IF{"'SOMEONE' ingroup 'GROUP'" then="THEN" else="ELSE"}%
Or to test the currently logged in user for AdminGroup membership:
You are %IF{
"$USERNAME ingroup 'AdminGroup'"
then="an admin"
else="a normal user"
}%
--
SvenDowideit - 06 Mar 2012
I think it helps a lot that there is now a different keyword. It also helps that there isn't a $-sign anymore.
Thanks!
--
SimonRissi - 09 Mar 2012