Item11606: Documentation 'ifStatements ==> ingroup-Function'
Priority: Low
Current State: Closed
Released In: 1.1.5
Target Release: patch
Applies To: Engine
Component: Documentation
Branches: Release01x01 trunk
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