From: Mirko F. <mfr...@gm...> - 2013-01-11 14:29:01
|
Hello, filed as: https://issues.jfrog.org/jira/browse/RTFACT-5368 Regards Mirko On Fri, Jan 4, 2013 at 5:13 PM, Mirko Friedenhagen <mfr...@gm...> wrote: > Hello, > > I try to use freemarker templates with settings.xml (as in > http://wiki.jfrog.org/confluence/display/RTF/Filtered+Resources), > however the user's groupNames seem not to be iterable? (Groupnames are > from LDAP). > > I have something like (my test user is member of 6 groups): > > <#list security.getCurrentUserGroupNames() as groupName> > <activeProfile>${groupName}</activeProfile> > </#list> > > and this results in: > > <activeProfile>ONE_VALID_GROUPNAME</activeProfile> > <activeProfile>${groupName}</activeProfile> > <activeProfile>${groupName}</activeProfile> > <activeProfile>${groupName}</activeProfile> > <activeProfile>${groupName}</activeProfile> > <activeProfile>${groupName}</activeProfile> > > I tried something like: > > <#assign nGroups = security.getCurrentUserGroupNames()?size - 1/> > <#list 0..nGroups as i> > <activeProfile>${security.getCurrentUserGroupNames()[i]}</activeProfile> > </#list> > > and this this resulted in: > > <activeProfile>ONE_VALID_GROUPNAME</activeProfile> > <activeProfile>${security.getCurrentUserGroupNames()[i]}</activeProfile> > <activeProfile>${security.getCurrentUserGroupNames()[i]}</activeProfile> > <activeProfile>${security.getCurrentUserGroupNames()[i]}</activeProfile> > <activeProfile>${security.getCurrentUserGroupNames()[i]}</activeProfile> > <activeProfile>${security.getCurrentUserGroupNames()[i]}</activeProfile> > > When I try to access groupName in an <#if> I always get INVALID.REFs > > <#list security.getCurrentUserGroupNames() as groupName> > <#if groupName == "I_DO_NOT_EXIST"> > <activeProfile>I_DO_NOT_EXIST</activeProfile> > <#else/> > <!-- hello --> > </#if> > </#list> > > I get: > > <!-- hello --> > ${INVALID.REF}${INVALID.REF}${INVALID.REF}${INVALID.REF}${INVALID.REF} > > Now I am quite puzzled what is going on, googling and looking at > stackoverflow did not help either. My user is member of 6 groups, so > at least this is correct :-). I played with <#assign groupNames = > security.getCurrentUserGroupNames()/> as well, did not help. Any hints > would be appreciated. > > Regards Mirko |