No you don't have to be superuser. The code above seems to work just fine for me. Make sure your public user has write access to the repo tho.
Few notes tho, spec says (17.3 Lock owner): "Strictly speaking it is the session, not the user, that owns a particular lock at a particular time" and later in same section "user will not automatically have the ability to alter the locked node if accessing it through another session". That might or might not be relevant depending on whether the above code was concatenation of code executed in different places or is ran verbatim. I've also noticed in that code that you are locking "test1" folder, but creating "test2" next to it. is that on purpose? As a side note, I was also wondering why to bother w/ locking at all? What does it guard here? First idea I had was that you are trying to copy content of the folder into another, but that would not be protected anyway because you are using shallow lock and not the deep one. You are not even protecting against removal of the "test1" since spec clearly states in multiple places that removal of a node is operation performed on it's parent (so in case of the example above, you would have to have locked the root node itself, which unfortunately is not lockable). And as a last remark, consider digging into spec section 17.10 Locks and Transactions - it seems like the ops in example above fits directly in when they describe as being of no consequence (due to all session ops being persisted only on safe and the fact that magnolia creates sessions per request and doesn't share them with multiple threads) ... unless of course the above is just a simplification of what you are really doing. HTH, Jan -- Context is everything: http://forum.magnolia-cms.com/forum/thread.html?threadId=a3f1e0a0-8331-4a95-a4e8-e591880db620 ---------------------------------------------------------------- For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
