|
Oszkar Nagy made changes - 09-Mar-2010 04:20
Oszkar Nagy made changes - 26-Mar-2010 05:06
Ian Boston made changes - 26-Mar-2010 23:58
Ray Davis made changes - 30-Mar-2010 09:32
Ray Davis made changes - 30-Mar-2010 09:32
This is specifically an issue when moving a site to a new location under "/sites". The "/sites" root node is not writable via normal JCR privileges. Instead, the site-create servlet uses a component-specific pseudo-privilege property to decide whether the current user can add children to the node. (This is the logic that kicks in when the client posts to "/sites.createsite".) The same pseudo-privilege needs to somehow be supported for move and copy operations.
My initial test seems to indicate that it *is* possible to move an existing site so long as the user has proper access to the destination parent node. Sling's usual recommendation for adding resourceType-specific functionality to the normal SlingPostServlet is via a SlingPostProcessor. (That's how the Site component handles site access-scheme updates, for example.) But IIRC when I tried a couple of months ago, I found that a post-processor *on* a resource doesn't help much with opening up access *to* the resource, and I also had problems trying to use a request wrapper to get around normal access controls. So there may not be as clean a fix as I'd like.
One way to approach this would be to add two new parameters to the "createsite" POST API:
":moveFrom" = the existing site which should be moved to the ":sitepath" location ":copyFrom" = the existing site which should be copied to the ":sitepath" location Like I say, not squeaky clean, but at least it would keep the site-creation access check in one place.
Checked in fix as http://github.com/raydavis/open-experiments/commit/1aee2eb5f35819e8d94399c621944d6d56a7cde2
That commit includes some pretty massive refactoring to deal with the four-way workflow. On the plus side, that should make it easier to extract these operations into server-side services should the need arise. I'll leave this task assigned to me and unresolved until Ian merges and I've updated the client-server documentation on Confluence.
Ray Davis made changes - 02-Apr-2010 09:38
Ian has merged and I've updated <http://confluence.sakaiproject.org//x/GIDzAQ>.
Ray Davis made changes - 02-Apr-2010 09:39
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adding info from log:
29.03.2010 15:20:04.765 *ERROR* [127.0.0.1 [1269872404759] POST /sites/test2 HTTP/1.1] org.apache.sling.servlets.post.impl.operations.MoveOperation Exception during response processing. javax.jcr.AccessDeniedException: Not allowed to move node /sites/test2 to /sites/pupeka
at org.apache.jackrabbit.core.SessionImpl.move(SessionImpl.java:1109)
at org.apache.sling.servlets.post.impl.operations.MoveOperation.execute(MoveOperation.java:58)
at org.apache.sling.servlets.post.impl.operations.AbstractCopyMoveOperation.doRun(AbstractCopyMoveOperation.java:111)
at org.apache.sling.servlets.post.AbstractSlingPostOperation.run(AbstractSlingPostOperation.java:87)
at org.apache.sling.servlets.post.impl.SlingPostServlet.doPost(SlingPostServlet.java:178)
at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:143)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:338)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:369)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:525)
at org.apache.sling.engine.impl.SlingMainServlet.processRequest(SlingMainServlet.java:421)
at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:48)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)
at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:59)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
at org.sakaiproject.nakamura.persistence.TransactionManagerFilter.doFilter(TransactionManagerFilter.java:95)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
at org.sakaiproject.nakamura.cluster.ClusterTrackingFilter.doFilter(ClusterTrackingFilter.java:87)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:306)
at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:202)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
at org.ops4j.pax.web.service.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:64)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.ops4j.pax.web.service.internal.HttpServiceContext.handle(HttpServiceContext.java:111)
at org.ops4j.pax.web.service.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:64)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:880)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)