Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-21553

Some of the cascade rules in the ContentPermission and ContentPermissionSet hibernate mapping files could be changed to "save-update" instead of "all"

XMLWordPrintable

      The cascade rules in ContentPermission.hbm.xml and ContentPermissionSet.hbm.xml cause the parent relation to be deleted.
      This most likely shouldn't happen. Usually this isn't a problem because we nullify the reference to the parent programmatically, but if this fails the owning content object gets deleted when a content permission is removed.

      diff --git a/confluence/src/etc/java/com/atlassian/confluence/security/ContentPermission.hbm.xml
      
      - <many-to-one name="owningSet" class="com.atlassian.confluence.security.ContentPermissionSet" cascade="all"
      + <many-to-one name="owningSet" class="com.atlassian.confluence.security.ContentPermissionSet" cascade="save-update"
      
      diff --git a/confluence/src/etc/java/com/atlassian/confluence/security/ContentPermissionSet.hbm.xml
      
      - <many-to-one name="owningContent" class="com.atlassian.confluence.core.ContentEntityObject" cascade="all"
      + <many-to-one name="owningContent" class="com.atlassian.confluence.core.ContentEntityObject" cascade="save-update"
      

            nbhawnani Niraj Bhawnani
            ssaasen Stefan Saasen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: