Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-2900

Inclusion of groups in groups aren't taken into account when querying user memberships

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • None
    • 1.7 RC1
    • Old Core

    Description

      This query is used to retreive groups memberships for a user. It won't match included groups.

      from devs@xwiki.org :

      I installed recently the 1.6 version of XWiki and found that a new
      functionnality allows to add logical groups to the group members list :
      great ! This recursive inclusion is properly managed in global rights (like
      allowing a global group for accessing a space) but this does not seem to be
      included in velo xwiki API. For example I have one client that belongs to
      its company group XWiki.MyClientCompanyGroup that I added to the group
      XWiki.Clients. I have a dedicated part of my menu for clients and I tests
      whether the current user is a client or not with the test
      `$xwiki.user.isUserInGroup("XWiki.Clients")` which always return false
      Maybe a special macro could help... anyone has a clue ?

      Query listGroupsForUser doesn't take group inclusion into account.
      The query is used by XWikiGroupServiceImpl#listGroupsForUser(String, XWikiContext).

        <query name="listGroupsForUser">
          select doc.fullName from XWikiDocument as doc, BaseObject as obj, StringProperty as prop
          where obj.name = doc.fullName
            and obj.className='XWiki.XWikiGroups'
            and obj.id = prop.id.id and prop.id.name='member'
            and (prop.value=:username or prop.value=:shortname or prop.value=:veryshortname)
        </query>
      

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              jvdrean Jean-Vincent Drean
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: