Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
webservices
cern-search
cern-search-rest-api
Commits
a84b7fd3
Commit
a84b7fd3
authored
Nov 09, 2020
by
Carina Antunes
Browse files
fix test: access with use egroups
parent
4e0cbe67
Changes
3
Show whitespace changes
Inline
Side-by-side
.env
View file @
a84b7fd3
...
...
@@ -17,7 +17,7 @@ DEFAULT_RECORDS_FILES_LOCATION=/usr/share/cern-search-api/files
ENV=dev
FLASK_SKIP_DOTENV=1
FLASK_DEBUG='
Fals
e'
FLASK_DEBUG='
Tru
e'
INVENIO_DEBUG=0
FLOWER_PASS=password
...
...
cern_search_rest_api/modules/cernsearch/utils.py
View file @
a84b7fd3
...
...
@@ -11,6 +11,7 @@
from
elasticsearch
import
VERSION
as
ES_VERSION
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_search
import
current_search
,
current_search_client
from
invenio_search.utils
import
prefix_index
...
...
@@ -18,6 +19,9 @@ from invenio_search.utils import prefix_index
def
get_user_provides
():
"""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
]
...
...
tests/conftest.py
View file @
a84b7fd3
...
...
@@ -43,6 +43,7 @@ def user(db, app):
db
.
session
.
commit
()
app
.
config
[
'API_TOKEN'
]
=
token
.
access_token
app
.
config
[
'SEARCH_USE_EGROUPS'
]
=
True
yield
user
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment