mirror of https://gitee.com/bigwinds/arangodb
Fix WebUI Login with read-only (#6501)
This commit is contained in:
parent
6e4200d418
commit
71e5d2aa49
|
@ -102,12 +102,14 @@ VocbaseContext* VocbaseContext::create(GeneralRequest& req, TRI_vocbase_t& vocba
|
||||||
|
|
||||||
void VocbaseContext::forceSuperuser() {
|
void VocbaseContext::forceSuperuser() {
|
||||||
TRI_ASSERT(_type != ExecContext::Type::Internal || _user.empty());
|
TRI_ASSERT(_type != ExecContext::Type::Internal || _user.empty());
|
||||||
if (ServerState::readOnly()) {
|
|
||||||
return; // ignore force
|
|
||||||
}
|
|
||||||
_type = ExecContext::Type::Internal;
|
_type = ExecContext::Type::Internal;
|
||||||
|
if (ServerState::readOnly()) {
|
||||||
|
_systemDbAuthLevel = auth::Level::RO;
|
||||||
|
_databaseAuthLevel = auth::Level::RO;
|
||||||
|
} else {
|
||||||
_systemDbAuthLevel = auth::Level::RW;
|
_systemDbAuthLevel = auth::Level::RW;
|
||||||
_databaseAuthLevel = auth::Level::RW;
|
_databaseAuthLevel = auth::Level::RW;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VocbaseContext::forceReadOnly() {
|
void VocbaseContext::forceReadOnly() {
|
||||||
|
|
Loading…
Reference in New Issue