diff --git a/app/config/collections.php b/app/config/collections.php index be485316ab..91f0861dd7 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1862,7 +1862,7 @@ $commonCollections = [ 'filters' => [], ], [ - '$id' => ID::custom('providerType'), + '$id' => ID::custom('provider'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -1870,13 +1870,13 @@ $commonCollections = [ 'required' => false, 'default' => null, 'array' => false, - 'filters' => ['subQueryProviderType'], + 'filters' => ['subQueryProvider'], ], [ '$id' => ID::custom('identifier'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => Database::LENGTH_KEY, 'signed' => true, 'required' => true, 'default' => null, diff --git a/app/config/roles.php b/app/config/roles.php index abc00b55bf..6e09d838de 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -21,6 +21,10 @@ $member = [ 'avatars.read', 'execution.read', 'execution.write', + 'targets.read', + 'targets.write', + 'subscribers.write', + 'subscribers.read' ]; $admins = [ @@ -60,6 +64,16 @@ $admins = [ 'vcs.read', 'vcs.write', 'assistant.read', + 'targets.read', + 'targets.write', + 'providers.write', + 'providers.read', + 'messages.write', + 'messages.read', + 'topics.write', + 'topics.read', + 'subscribers.write', + 'subscribers.read' ]; return [ diff --git a/app/init.php b/app/init.php index 712d949dc6..ea1442d2d7 100644 --- a/app/init.php +++ b/app/init.php @@ -546,7 +546,7 @@ Database::addFilter( ); Database::addFilter( - 'subQueryProviderType', + 'subQueryProvider', function (mixed $value) { return null; }, @@ -555,16 +555,14 @@ Database::addFilter( ->getDocument( 'providers', $document->getAttribute('providerId'), - [Query::select(['type'])] )); - if ($provider) { - return $provider->getAttribute('type'); + if (!$provider->isEmpty()) { + return $provider; } return null; } ); - Database::addFilter( 'subQueryTopicTargets', function (mixed $value) {