tests/IResearch/IResearchAnalyzerFeature-test.cpp
TEST_F(IResearchAnalyzerFeatureTest, test_auth_vocbase_ro_collection_none) {
  TRI_vocbase_t vocbase(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, testDBInfo(server.server()));
  userSetAccessLevel(arangodb::auth::Level::RO, arangodb::auth::Level::NONE);
  auto ctxt = getLoggedInContext();
  arangodb::ExecContextScope execContextScope(ctxt.get());
  // implicit RO access to collection _analyzers collection granted due to RO access to db
  EXPECT_TRUE(arangodb::iresearch::IResearchAnalyzerFeature::canUse(vocbase,
                                                                    arangodb::auth::Level::RO));

  EXPECT_FALSE(arangodb::iresearch::IResearchAnalyzerFeature::canUse(vocbase, arangodb::auth::Level::RW));
}
// no collection read access (vocbase read access)
no collection read access (vocbase read access)
no collection read access ( vocbase read access )
TEST_F(IResearchAnalyzerFeatureTest, test_auth_vocbase_ro_collection_none) {
  TRI_vocbase_t vocbase(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, testDBInfo(server.server()));
  userSetAccessLevel(arangodb::auth::Level::RO, arangodb::auth::Level::NONE);
  auto ctxt = getLoggedInContext();
  arangodb::ExecContextScope execContextScope(ctxt.get());
  EXPECT_TRUE(arangodb::iresearch::IResearchAnalyzerFeature::canUse(vocbase,
                                                                    arangodb::auth::Level::RO));
  EXPECT_FALSE(arangodb::iresearch::IResearchAnalyzerFeature::canUse(vocbase, arangodb::auth::Level::RW));
}
TEST_F ( IResearchAnalyzerFeatureTest , test_auth_vocbase_ro_collection_none ) { TRI_vocbase_t vocbase ( TRI_vocbase_type_e :: TRI_VOCBASE_TYPE_NORMAL , testDBInfo ( server . server ( ) ) ) ; userSetAccessLevel ( arangodb :: auth :: Level :: RO , arangodb :: auth :: Level :: NONE ) ; auto ctxt = getLoggedInContext ( ) ; arangodb :: ExecContextScope execContextScope ( ctxt . get ( ) ) ; EXPECT_TRUE ( arangodb :: iresearch :: IResearchAnalyzerFeature :: canUse ( vocbase , arangodb :: auth :: Level :: RO ) ) ; EXPECT_FALSE ( arangodb :: iresearch :: IResearchAnalyzerFeature :: canUse ( vocbase , arangodb :: auth :: Level :: RW ) ) ; }
no collection read access (vocbase read access)
no collection read access ( vocbase read access )
// implicit RO access to collection _analyzers collection granted due to RO access to db