You are here: Foswiki>Tasks Web>Item11606 (11 Apr 2012, GeorgeClark)Edit Attach

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
Reported By: SimonRissi
Waiting For:
Last Change By: GeorgeClark
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:

-- 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
Checkins distro:33b9f60034eb distro:917e5556f62b distro:b919f45f7541
TargetRelease patch
ReleasedIn 1.1.5
CheckinsOnBranches Release01x01 trunk
trunkCheckins distro:33b9f60034eb distro:917e5556f62b
Release01x01Checkins distro:b919f45f7541
Topic revision: r9 - 11 Apr 2012, GeorgeClark - This page was cached on 16 Oct 2020 - 22:13.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy