fix(functions): fix permissions for function domains
Execution via domain should be blocked if permissions does not contain any and permissions does not contain guests.
This commit is contained in:
parent
901a1b8b65
commit
7604d35138
|
@ -156,7 +156,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo
|
|||
|
||||
$permissions = $function->getAttribute('execute');
|
||||
|
||||
if (!(\in_array('any', $permissions)) && (\in_array('guests', $permissions))) {
|
||||
if (!(\in_array('any', $permissions)) && !(\in_array('guests', $permissions))) {
|
||||
throw new AppwriteException(AppwriteException::USER_UNAUTHORIZED, 'To execute function using domain, execute permissions must include "any" or "guests"');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue