Will,

Are we still talking about a bug? Maybe the javadoc needs clarification? (I am not reading the code while writing this;)) - the normally behaviour if you try to create /foo/bar, is to check if you have the "write" permission on /foo. Was something else happening with either of both ContentUtil methods?

Also - are you working with 3.7 snapshots or 3.6?

Thanks,

-g

On Oct 2, 2008, at 9:42 PM, Will Scheidegger wrote:

Answering my own question:

Yes, its

ContentUtil.createPath(HierarchyManager hm, String path, ItemType type)

which causes the problems because it tries to get the root node as parent node. So if you _have_ an existing base folder where your user has access to you can use

ContentUtil.createPath(Content parent, String path, ItemType type)

and you'll be fine.

Cheers,
will

On 02.10.2008, at 21:18, Will Scheidegger wrote:

Dear Magnolians

I'm currently working on a Magnolia site where registered users can create data module records. Their records are placed in a folder structure just like the HierarchicalUserManager structures the user accounts. All these folders are kept in one base folder, e.g. "/ base". The role for these users of course has read+write permission on this folder and its subfolders.

For some strange reason however I'm getting an AccessDeniedException when trying to create subfolders to the "/ base" folder because "User not allowed to Read path [/]". The first few lines of the stack trace are:

      at info.magnolia.cms.core.Access.isGranted(Access.java:63)
at info.magnolia.cms.core.DefaultContent.<init>(DefaultContent.java:144) at info .magnolia .cms .core.DefaultHierarchyManager.getRoot(DefaultHierarchyManager.java: 408) at info.magnolia.cms.util.ContentUtil.createPath(ContentUtil.java:374) at ch .fastforward .coach .controller.CoachController.createNewNode(CoachController.java:122)

And that line 122 in my CoachController class is:

ContentUtil.createPath(MgnlContext.getHierarchyManager("data"), parentPath, new ItemType("dataFolder"), true);

Now why does this code try to read from "/"? I don't think it really has to, because creating folders and data nodes in Admin Central works perfectly find for a user that only has read+write permissions to "/base" instead of "/"... Is this a bug? Or is it the nature of the "createPath" method that it tries to access all parts of the path from the root up?

Regards,
Will

----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------

Reply via email to