Hello, does anybody out there have a working example using security.getCurrentUserGroupNames() or am I the only?
Regards Mirko On Fri, Jan 11, 2013 at 3:28 PM, Mirko Friedenhagen <[email protected]> wrote: > Hello, > > filed as: https://issues.jfrog.org/jira/browse/RTFACT-5368 > > > Regards Mirko > > On Fri, Jan 4, 2013 at 5:13 PM, Mirko Friedenhagen > <[email protected]> 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 ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d _______________________________________________ Artifactory-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/artifactory-users
