PermissionHelper is sending incorrect data

XMLWordPrintable

    • 1
    • Severity 2 - Major

      h3 summary

      Permissionhelper didn't send right results for user who should be able to change permissions

      Environment

      Confluence 6.1.3

      Steps to reproduce

      1. Create a group in Active Directory named "app-confluence-space-keyuser", and add some users i.e "test"
      2. Create a group in Active Directory named "app-confluence-space-user", and add some users
      3. Permit each group with the right configuration:app-confluence-space-user can't set/change permissions and "app-confluence-space-keyuser" can set/change permissions
      4. It's important that a user in "app-confluence-space-keyuser" and doublecheck this group has permissions to change rights

      Permission Helper is used

      #set($containerManagerClass = $content.class.forName('com.atlassian.spring.container.ContainerManager'))
      #set($getInstanceMethod = $containerManagerClass.getDeclaredMethod('getInstance',null))
      #set($containerManager = $getInstanceMethod.invoke(null,null))
      #set($containerContext = $containerManager.containerContext)
      #set($users = $userAccessor.getUsers())
      #set($spaces = $spaceManager.getAllSpaces())
      <table class="aui">
      <tr>
      <th class="confluenceTh">KeyUser</th>
      </tr>
      #foreach($spacer in $spaces)
      #if ($spacer.key == $space.key)
      #foreach($user in $users)
      #if ($permissionHelper.canSetPermissions($user, $spacer) and not $permissionHelper.isConfluenceAdministrator($user))
      <tr>
      <td class="confluenceTd">#usernameLink($user.name)</td>
      </tr>
      #else
      #end
      #end
      #end
      #end
      </table>

      Expected result

      User has rights to change permissions
      User has no rights to administrate
      You can see the macro output, that the function
      $permissionHelper.canSetPermission output "false", but in the configuration you can see it is set true.

      Actual Results

      permissionhelper didn't send right results for user "test"

              Assignee:
              Unassigned
              Reporter:
              Aya Mohamed (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: