thexerteproject / xerteonlinetoolkits

Xerte Online Toolkits
www.xerte.org.uk
Apache License 2.0
62 stars 61 forks source link

Issue with shared folder within a shared folder #1253

Closed torinfo closed 9 months ago

torinfo commented 9 months ago

Suppose you have this structure as user owner

Library  (read-only to p1 and p2)
  |
  +-> Languages (not shared by it self but through Library)
  |
  +-> Spanish (co-author to p1 and p2)

This works.

Now the owner moves Spanish under Languages:

Library  (read-only to p1 and p2)
  |
  +-> Languages (not shared by it self but through Library)
  |       |
  |       +-> Spanish (co-author to p1 and p2)
  |

Now the the workspace for p1 and p2 do not work any more.

I already know this goes wrong (and we should be able to reproduce this ourselves) because 'Library' is shared and 'Spanish' is shared too with the same people but 'Languages' is not. I think that in the code the order of execution is wrong. At some point it retrieves all the folders the user has access to (in this case it returns Library and Spanish, because those folders are mentioned in folderrights table). Then the tree structure is built (the parent->child relations are set). Than the sub folders of the shared folders are added. That last step should have been done before building the tree structure.