Early reject when user is anonymous.
This cuts down on info-level log entries, and prevents some Mongo queries.
This commit is contained in:
@@ -118,6 +118,10 @@ def attract_project_view(extra_project_projections: dict=None, extension_props=F
|
|||||||
# just pass everything along.
|
# just pass everything along.
|
||||||
return wrapped(project_url, *args, **kwargs)
|
return wrapped(project_url, *args, **kwargs)
|
||||||
|
|
||||||
|
if current_user.is_anonymous:
|
||||||
|
log.debug('attract_project_view: Anonymous user never has access to Attract.')
|
||||||
|
raise wz_exceptions.Forbidden()
|
||||||
|
|
||||||
api = pillar_api()
|
api = pillar_api()
|
||||||
|
|
||||||
projection_param = None if full_project else {'projection': projections}
|
projection_param = None if full_project else {'projection': projections}
|
||||||
|
Reference in New Issue
Block a user