Review fixes

This commit is contained in:
Jake Barnby
2025-10-22 00:30:00 +13:00
parent 505181d749
commit 71f52025ec
2 changed files with 22 additions and 10 deletions
+2 -2
View File
@@ -1069,9 +1069,9 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
->param('roles', [], function (Document $project, Database $dbForProject) {
if ($project->getId() === 'console') {
$roles = array_keys(Config::getParam('roles', []));
array_filter($roles, function ($role) {
$roles = array_values(array_filter($roles, function ($role) {
return !in_array($role, [Auth::USER_ROLE_APPS, Auth::USER_ROLE_GUESTS, Auth::USER_ROLE_USERS]);
});
}));
return new ArrayList(new WhiteList($roles), APP_LIMIT_ARRAY_PARAMS_SIZE);
}
return new ArrayList(new Key(false, $dbForProject->getAdapter()->getMaxUIDLength()), APP_LIMIT_ARRAY_PARAMS_SIZE);
+20 -8
View File
@@ -233,16 +233,28 @@ class Install extends Action
$mongoInitScript = __DIR__ . '/../../../../mongo-init.js';
$mongoEntrypoint = __DIR__ . '/../../../../mongo-entrypoint.sh';
if (file_exists($mongoInitScript)) {
if (!copy($mongoInitScript, $this->path . '/mongo-init.js')) {
Console::warning('Failed to copy mongo-init.js');
}
if (!file_exists($mongoInitScript)) {
$message = 'Required MongoDB initialization file not found: mongo-init.js';
Console::error($message);
Console::exit(1);
}
if (file_exists($mongoEntrypoint)) {
if (!copy($mongoEntrypoint, $this->path . '/mongo-entrypoint.sh')) {
Console::warning('Failed to copy mongo-entrypoint.sh');
}
if (!copy($mongoInitScript, $this->path . '/mongo-init.js')) {
$message = 'Failed to copy mongo-init.js - this file is required for MongoDB replica set setup';
Console::error($message);
Console::exit(1);
}
if (!file_exists($mongoEntrypoint)) {
$message = 'Required MongoDB initialization file not found: mongo-entrypoint.sh';
Console::error($message);
Console::exit(1);
}
if (!copy($mongoEntrypoint, $this->path . '/mongo-entrypoint.sh')) {
$message = 'Failed to copy mongo-entrypoint.sh - this file is required for MongoDB replica set setup';
Console::error($message);
Console::exit(1);
}
}