允许引导密钥补授权迁移操作员
正确 bootstrap secret 可补充数据库迁移 operator。 保留无 bootstrap 时必须由现有 operator 授权的约束。
This commit is contained in:
@@ -2419,9 +2419,10 @@ fn authorize_database_migration_operator_tx(
|
||||
note: String,
|
||||
) -> Result<(), String> {
|
||||
let has_operator = ctx.db.database_migration_operator().iter().next().is_some();
|
||||
if has_operator {
|
||||
let has_valid_bootstrap_secret = require_migration_bootstrap_secret(bootstrap_secret).is_ok();
|
||||
if has_operator && !has_valid_bootstrap_secret {
|
||||
require_migration_operator(ctx, caller)?;
|
||||
} else {
|
||||
} else if !has_operator {
|
||||
require_migration_bootstrap_secret(bootstrap_secret)?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user