Commit 1894283f5e75d280fa2b857a9ae1611fe4cfc7ba
1 parent
fa97e6b0
Merged in...
KTS-3777 "CLONE -Permissions of a document can be inconsistent with the permissions of the folder(SUP-1080)" Fixed. On a copy the folder will define it own permissions if the original folder did. Committed by: Megan Watson Reviewed by: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.4-Release-Branch@9523 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
5 additions
and
2 deletions
lib/foldermanagement/folderutil.inc.php
| @@ -457,9 +457,9 @@ class KTFolderUtil { | @@ -457,9 +457,9 @@ class KTFolderUtil { | ||
| 457 | // Get source PO id and its parent PO id | 457 | // Get source PO id and its parent PO id |
| 458 | $iSrcPoId = $oSrcFolder->getPermissionObjectID(); | 458 | $iSrcPoId = $oSrcFolder->getPermissionObjectID(); |
| 459 | $oSrcParent = Folder::get($oSrcFolder->getParentID()); | 459 | $oSrcParent = Folder::get($oSrcFolder->getParentID()); |
| 460 | - $iSrcParentPoId = $srcParent->getPermissionObjectID(); | 460 | + $iSrcParentPoId = $oSrcParent->getPermissionObjectID(); |
| 461 | 461 | ||
| 462 | - // If the folder defines its own permissions then we leave it | 462 | + // If the folder defines its own permissions then we copy the permission object |
| 463 | // If the source folder inherits permissions we must change it to inherit from the new parent folder | 463 | // If the source folder inherits permissions we must change it to inherit from the new parent folder |
| 464 | $bInheritPermissions = false; | 464 | $bInheritPermissions = false; |
| 465 | if($iSrcPoId == $iSrcParentPoId){ | 465 | if($iSrcPoId == $iSrcParentPoId){ |
| @@ -609,11 +609,14 @@ class KTFolderUtil { | @@ -609,11 +609,14 @@ class KTFolderUtil { | ||
| 609 | } | 609 | } |
| 610 | 610 | ||
| 611 | // If the folder inherits its permissions then we set it to inherit from the new parent folder and update permissions | 611 | // If the folder inherits its permissions then we set it to inherit from the new parent folder and update permissions |
| 612 | + // If it defines its own then copy the permission object over | ||
| 612 | if($bInheritPermissions){ | 613 | if($bInheritPermissions){ |
| 613 | $aOptions = array( | 614 | $aOptions = array( |
| 614 | 'evenifnotowner' => true, // Inherit from parent folder, even though not permission owner | 615 | 'evenifnotowner' => true, // Inherit from parent folder, even though not permission owner |
| 615 | ); | 616 | ); |
| 616 | KTPermissionUtil::inheritPermissionObject($oNewBaseFolder, $aOptions); | 617 | KTPermissionUtil::inheritPermissionObject($oNewBaseFolder, $aOptions); |
| 618 | + }else{ | ||
| 619 | + KTPermissionUtil::copyPermissionObject($oNewBaseFolder); | ||
| 617 | } | 620 | } |
| 618 | 621 | ||
| 619 | // and store | 622 | // and store |