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 HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Artifactory-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/artifactory-users

Reply via email to