1
0
Fork 0
mirror of synced 2024-06-14 16:54:52 +12:00

hide execution stdout and stderr on client side response

This commit is contained in:
Damodar Lohani 2022-08-14 08:54:11 +00:00
parent 734454ee85
commit 3ce8565513

View file

@ -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,