mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Allow validator to read logs collections from base
This commit is contained in:
parent
3f8e1cbedb
commit
5efd231861
1 changed files with 10 additions and 1 deletions
|
|
@ -24,7 +24,15 @@ class Base extends Queries
|
|||
public function __construct(string $collection, array $allowedAttributes)
|
||||
{
|
||||
$config = Config::getParam('collections', []);
|
||||
$collections = array_merge($config['projects'], $config['buckets'], $config['databases'], $config['console']);
|
||||
|
||||
$collections = array_merge(
|
||||
$config['projects'],
|
||||
$config['buckets'],
|
||||
$config['databases'],
|
||||
$config['console'],
|
||||
$config['log']
|
||||
);
|
||||
|
||||
$collection = $collections[$collection];
|
||||
// array for constant lookup time
|
||||
$allowedAttributesLookup = [];
|
||||
|
|
@ -35,6 +43,7 @@ class Base extends Queries
|
|||
$attributes = [];
|
||||
foreach ($collection['attributes'] as $attribute) {
|
||||
$key = $attribute['$id'];
|
||||
|
||||
if (!isset($allowedAttributesLookup[$key])) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue