mirror of
https://github.com/appwrite/appwrite
synced 2026-05-21 16:08:22 +00:00
Merge pull request #8496 from appwrite/fix-add-scopes-to-function-template
Add scopes to function template
This commit is contained in:
commit
ce438f182c
2 changed files with 10 additions and 0 deletions
|
|
@ -110,6 +110,13 @@ class TemplateFunction extends Model
|
|||
'default' => [],
|
||||
'example' => [],
|
||||
'array' => true
|
||||
])
|
||||
->addRule('scopes', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function scopes.',
|
||||
'default' => [],
|
||||
'example' => 'users.read',
|
||||
'array' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -881,6 +881,9 @@ class FunctionsCustomClientTest extends Scope
|
|||
$this->assertEquals($expectedTemplates[$i]['vcsProvider'], $templates['body']['templates'][$i]['vcsProvider']);
|
||||
$this->assertEquals($expectedTemplates[$i]['runtimes'], $templates['body']['templates'][$i]['runtimes']);
|
||||
$this->assertEquals($expectedTemplates[$i]['variables'], $templates['body']['templates'][$i]['variables']);
|
||||
if (array_key_exists('scopes', $expectedTemplates[$i])) {
|
||||
$this->assertEquals($expectedTemplates[$i]['scopes'], $templates['body']['templates'][$i]['scopes']);
|
||||
}
|
||||
}
|
||||
|
||||
$templates_offset = $this->client->call(Client::METHOD_GET, '/functions/templates', array_merge([
|
||||
|
|
|
|||
Loading…
Reference in a new issue