Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Make authorization per-instance #343

Merged
merged 14 commits into from
Jan 25, 2024
117 changes: 56 additions & 61 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions src/Database/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Exception;
use Utopia\Database\Exception as DatabaseException;
use Utopia\Database\Validator\Authorization;

abstract class Adapter
{
Expand All @@ -24,6 +25,23 @@ abstract class Adapter

protected static ?int $timeout = null;

/**
* @var Authorization
*/
protected Authorization $authorization;

/**
* @param Authorization $authorization
*
* @return $this
*/
public function setAuthorization(Authorization $authorization): self
{
$this->authorization = $authorization;

return $this;
}

/**
* @param string $key
* @param mixed $value
Expand Down
Loading