Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix rights management : do not assign minisite-role for remote shares.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Mar 1, 2016
1 parent dd3c570 commit 855b780
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/plugins/action.share/class.ShareRightsManager.php
Expand Up @@ -114,6 +114,9 @@ public function prepareSharedUserEntry($httpVars, &$shareObject, $update, $guest
throw new Exception("share_center.58");
}
$hiddenUserEntry["DISABLE_DOWNLOAD"] = $shareObject->disableDownload();
if($shareObject instanceof \Pydio\OCS\Model\TargettedLink){
$hiddenUserEntry["REMOTE"] = true;
}
return $hiddenUserEntry;
}

Expand Down Expand Up @@ -194,7 +197,7 @@ public function createUsersFromParameters($httpVars, &$users = array(), &$groups
throw new Exception("You are not allowed to create users.");
}
if(!empty($this->options["SHARED_USERS_TMP_PREFIX"]) && strpos($u, $this->options["SHARED_USERS_TMP_PREFIX"])!==0 ){
$u = $this->tmpUsersPrefix . $u;
$u = $this->options["SHARED_USERS_TMP_PREFIX"] . $u;
}
}
$entry = array("ID" => $u, "TYPE" => "user");
Expand Down Expand Up @@ -406,7 +409,7 @@ public function assignSharedRepositoryPermissions($parentRepository, $childRepos
}

// CREATE A MINISITE-LIKE ROLE FOR THIS REPOSITORY
if (isSet($userEntry["HIDDEN"])) {
if (isSet($userEntry["HIDDEN"]) && !isSet($userEntry["REMOTE"])) {
$minisiteRole = $this->createRoleForMinisite($childRepoId, $userEntry["DISABLE_DOWNLOAD"], $isUpdate);
if($minisiteRole != null){
$userObject->addRole($minisiteRole);
Expand Down

0 comments on commit 855b780

Please sign in to comment.