Commit 1894283f5e75d280fa2b857a9ae1611fe4cfc7ba

Authored by kevin_fourie
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
lib/foldermanagement/folderutil.inc.php
... ... @@ -457,9 +457,9 @@ class KTFolderUtil {
457 457 // Get source PO id and its parent PO id
458 458 $iSrcPoId = $oSrcFolder->getPermissionObjectID();
459 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 463 // If the source folder inherits permissions we must change it to inherit from the new parent folder
464 464 $bInheritPermissions = false;
465 465 if($iSrcPoId == $iSrcParentPoId){
... ... @@ -609,11 +609,14 @@ class KTFolderUtil {
609 609 }
610 610  
611 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 613 if($bInheritPermissions){
613 614 $aOptions = array(
614 615 'evenifnotowner' => true, // Inherit from parent folder, even though not permission owner
615 616 );
616 617 KTPermissionUtil::inheritPermissionObject($oNewBaseFolder, $aOptions);
  618 + }else{
  619 + KTPermissionUtil::copyPermissionObject($oNewBaseFolder);
617 620 }
618 621  
619 622 // and store
... ...