Commit a84b7fd3 authored by Carina Antunes's avatar Carina Antunes
Browse files

fix test: access with use egroups

parent 4e0cbe67
...@@ -17,7 +17,7 @@ DEFAULT_RECORDS_FILES_LOCATION=/usr/share/cern-search-api/files ...@@ -17,7 +17,7 @@ DEFAULT_RECORDS_FILES_LOCATION=/usr/share/cern-search-api/files
ENV=dev ENV=dev
FLASK_SKIP_DOTENV=1 FLASK_SKIP_DOTENV=1
FLASK_DEBUG='False' FLASK_DEBUG='True'
INVENIO_DEBUG=0 INVENIO_DEBUG=0
FLOWER_PASS=password FLOWER_PASS=password
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
from elasticsearch import VERSION as ES_VERSION from elasticsearch import VERSION as ES_VERSION
from flask import current_app, g from flask import current_app, g
from flask_login import current_user
from invenio_indexer.utils import default_record_to_index, schema_to_index from invenio_indexer.utils import default_record_to_index, schema_to_index
from invenio_search import current_search, current_search_client from invenio_search import current_search, current_search_client
from invenio_search.utils import prefix_index from invenio_search.utils import prefix_index
...@@ -18,6 +19,9 @@ from invenio_search.utils import prefix_index ...@@ -18,6 +19,9 @@ from invenio_search.utils import prefix_index
def get_user_provides(): def get_user_provides():
"""Extract the user's provides from g.""" """Extract the user's provides from g."""
current_app.logger.debug(f'Identity: {g.identity}')
current_app.logger.debug(f'Current User: {current_user}')
return [need.value for need in g.identity.provides] return [need.value for need in g.identity.provides]
......
...@@ -43,6 +43,7 @@ def user(db, app): ...@@ -43,6 +43,7 @@ def user(db, app):
db.session.commit() db.session.commit()
app.config['API_TOKEN'] = token.access_token app.config['API_TOKEN'] = token.access_token
app.config['SEARCH_USE_EGROUPS'] = True
yield user yield user
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment