diff --git a/ccm-cms/src/com/arsdigita/cms/ContentItem.java b/ccm-cms/src/com/arsdigita/cms/ContentItem.java index 875b808ef..626b5d1cd 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentItem.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentItem.java @@ -322,10 +322,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy { if (PARENT.equals(name)) { ContentItem ci = (ContentItem) dobj; - if (newVal == null) { - PermissionService.setContext - (ci, ci.getContentSection()); - } else { + if (newVal != null) { PermissionService.setContext (ci.getOID(), ((DataObject) newVal).getOID()); } @@ -429,22 +426,28 @@ public class ContentItem extends VersionedACSObject implements CustomCopy { } } + /* + + removed cg - object observer sets context based + on parent whenever parent is updated + protected void afterSave() { super.afterSave(); - + s_log.info("******After Save of object " + getOID()); // Set the object's context to its parent object for // permissioning. if (m_wasNew) { final ACSObject parent = getParent(); - if (parent == null) { + s_log.info("parent is null - set context to content section"); PermissionService.setContext(this, getContentSection()); } else { + s_log.info("parent is " + parent.getOID()); PermissionService.setContext(this, parent); } } } - + */ private void setDefaultContentSection() { s_log.debug("Setting the default content section"); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/TextPageBody.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/TextPageBody.java index ca584c5dc..c2a646caa 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/TextPageBody.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/TextPageBody.java @@ -104,7 +104,9 @@ public class TextPageBody extends TextAssetBody { TextPage item = getTextPage(s); TextAsset t = new TextAsset(); t.setName(item.getName() + "_text_" + item.getID()); - t.setParent(item); + // no need - cg. Text doesn't need a security context, + // and ownership of text is recorded in text_pages + // t.setParent(item); return t; } @@ -118,7 +120,10 @@ public class TextPageBody extends TextAssetBody { protected void updateTextAsset(PageState s, TextAsset a) { TextPage t = getTextPage(s); Assert.assertNotNull(t); - a.setParent(t); + // no need - cg. Text doesn't need a security context, + // and ownership of text is recorded in text_pages + + // a.setParent(t); t.setTextAsset(a); a.save(); t.save();