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

XMLWordPrintable

    • 2

      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"
      

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

              Created:
              Updated:
              Resolved: