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 smile

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! smile

-- SimonRissi - 09 Mar 2012
 

ItemTemplate edit

Summary Documentation 'ifStatements ==> ingroup-Function'
ReportedBy SimonRissi
Codebase 1.1.4, trunk
SVN Range
AppliesTo Engine
Component Documentation
Priority Low
CurrentState Closed
WaitingFor
Checkins Foswikirev:14218 Foswikirev:14219 Foswikirev:14220
TargetRelease patch
ReleasedIn 1.1.5
CheckinsOnBranches Release01x01 trunk
trunkCheckins Foswikirev:14218 Foswikirev:14219
Release01x01Checkins Foswikirev:14220
Topic revision: r9 - 11 Apr 2012, GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads