Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
use OCP\Federation\ICloudFederationShare;
use OCP\Federation\ICloudIdManager;
use OCP\Files\NotFoundException;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IGroupManager;
use OCP\ILogger;
Expand Down Expand Up @@ -105,6 +106,9 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
/** @var IGroupManager */
private $groupManager;

/** @var IConfig */
private $config;

/**
* CloudFederationProvider constructor.
*
Expand Down Expand Up @@ -136,7 +140,8 @@ public function __construct(IAppManager $appManager,
ICloudFederationFactory $cloudFederationFactory,
ICloudFederationProviderManager $cloudFederationProviderManager,
IDBConnection $connection,
IGroupManager $groupManager
IGroupManager $groupManager,
IConfig $config
) {
$this->appManager = $appManager;
$this->federatedShareProvider = $federatedShareProvider;
Expand All @@ -152,6 +157,7 @@ public function __construct(IAppManager $appManager,
$this->cloudFederationProviderManager = $cloudFederationProviderManager;
$this->connection = $connection;
$this->groupManager = $groupManager;
$this->config = $config;
}


Expand Down Expand Up @@ -641,6 +647,11 @@ protected function reshareRequested($id, array $notification) {
$senderId = $notification['senderId'];

$share = $this->federatedShareProvider->getShareById($id);

// We have to respect the default share permissions
$permissions = $share->getPermissions() & (int)$this->config->getAppValue('core', 'shareapi_default_permissions', (string)Constants::PERMISSION_ALL);
$share->setPermissions($permissions);

// don't allow to share a file back to the owner
try {
[$user, $remote] = $this->addressHandler->splitUserRemote($shareWith);
Expand Down