Skip to content

Commit

Permalink
fix(config): Fix constructor of config class
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jan 16, 2024
1 parent 0e51d90 commit 9f8d2c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 5 additions & 3 deletions lib/AppConfigOverwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@
namespace OCA\Guests;

use OC\AppConfig;
use OC\DB\ConnectionAdapter;
use OCP\IDBConnection;
use Psr\Log\LoggerInterface;

class AppConfigOverwrite extends AppConfig {

/** @var string[][] */
private $overWrite;

public function __construct(
ConnectionAdapter $conn,
IDBConnection $connection,
LoggerInterface $logger,
array $overWrite
) {
parent::__construct($conn->getInner());
parent::__construct($connection, $logger);
$this->overWrite = $overWrite;
}

Expand Down
13 changes: 9 additions & 4 deletions lib/RestrictionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use OCP\IUser;
use OCP\IUserSession;
use OCP\Settings\IManager;
use Psr\Log\LoggerInterface;

class RestrictionManager {
/** @var AppWhitelist */
Expand Down Expand Up @@ -119,11 +120,15 @@ public function lateSetupRestrictions(): void {
$this->userBackend->setAllowListing(false);

$this->server->registerService(AppConfig::class, function () {
return new AppConfigOverwrite($this->server->get(IDBConnection::class), [
'core' => [
'shareapi_only_share_with_group_members' => 'yes'
return new AppConfigOverwrite(
$this->server->get(IDBConnection::class),
$this->server->get(LoggerInterface::class),
[
'core' => [
'shareapi_only_share_with_group_members' => 'yes'
]
]
]);
);
});
}
}
Expand Down

0 comments on commit 9f8d2c8

Please sign in to comment.