mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
hide execution stdout and stderr on client side response
This commit is contained in:
@@ -1023,6 +1023,16 @@ App::get('/v1/functions/:functionId/executions')
|
||||
$results = $dbForProject->find('executions', $queries, $limit, $offset, [], [Database::ORDER_DESC], $cursorExecution ?? null, $cursorDirection);
|
||||
$total = $dbForProject->count('executions', $queries, APP_LIMIT_COUNT);
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
if ($isPrivilegedUser || $isAppUser) {
|
||||
$results = array_map(function ($execution) {
|
||||
$execution->setAttribute('stdout', '');
|
||||
$execution->setAttribute('stderr', '');
|
||||
}, $results);
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'executions' => $results,
|
||||
'total' => $total,
|
||||
|
||||
Reference in New Issue
Block a user