pyramid-cubicweb #5573119 Pyramid crashes when accessing admin only URL [open]

This happen if you access an admin URL as an anonymous user. Normally the user will be redirected to the login page.

Here's the traceback I get:
2015-06-29 15:12:37 - (waitress) ERROR: Exception when serving /blogentry/979
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/waitress/channel.py", line 337, in service
task.service()
File "/usr/lib/python2.7/dist-packages/waitress/task.py", line 173, in service
self.execute()
File "/usr/lib/python2.7/dist-packages/waitress/task.py", line 392, in execute
app_iter = self.channel.server.application(env, start_response)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/wsgicors.py", line 140, in __call__
return self.application(environ, custom_start_response)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/router.py", line 242, in __call__
response = self.invoke_subrequest(request, use_tweens=True)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/router.py", line 217, in invoke_subrequest
response = handle_request(request)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/home/rmeradi/src/pyramid-cubicweb/pyramid_cubicweb/bwcompat.py", line 145, in __call__
response = self.handler(request)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/router.py", line 163, in handle_request
response = view_callable(context, request)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/config/views.py", line 596, in __call__
return view(context, request)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/config/views.py", line 329, in attr_view
return view(context, request)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/config/views.py", line 305, in predicate_wrapper
return view(context, request)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/config/views.py", line 287, in _authdebug_view
return view(context, request)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/config/views.py", line 385, in viewresult_to_response
result = view(context, request)
File "/home/rmeradi/src/pyramid-cubicweb/pyramid_cubicweb/entities.py", line 84, in get_entity
return render('primary', request, context.rset)
File "/home/rmeradi/.venv/lib/python2.7/site-packages/pyramid/decorator.py", line 37, in __get__
val = self.wrapped(inst)
File "/home/rmeradi/src/pyramid-cubicweb/pyramid_cubicweb/entities.py", line 26, in rset
st.as_string(), {'x': int(self.value)})
File "/home/rmeradi/src/cubicweb/web/request.py", line 1013, in execute
rset = self.cnx.execute(*args, **kwargs)
File "/home/rmeradi/src/cubicweb/server/session.py", line 181, in check_open
return func(cnx, *args, **kwargs)
File "/home/rmeradi/src/cubicweb/server/session.py", line 810, in execute
rset = self._execute(self, rql, kwargs, build_descr)
File "/home/rmeradi/src/cubicweb/server/querier.py", line 605, in execute
self._planner.build_plan(plan)
File "/home/rmeradi/src/cubicweb/server/ssplanner.py", line 138, in build_plan
for step in build_plan(plan, plan.rqlst):
File "/home/rmeradi/src/cubicweb/server/ssplanner.py", line 147, in build_select_plan
plan.preprocess(rqlst)
File "/home/rmeradi/src/cubicweb/server/querier.py", line 220, in preprocess
noinvariant = self._insert_security(union)
File "/home/rmeradi/src/cubicweb/server/querier.py", line 237, in _insert_security
localchecks, restricted = self._check_permissions(select)
File "/home/rmeradi/src/cubicweb/server/querier.py", line 301, in _check_permissions
raise Unauthorized('No read acces on %r with eid %i.' % (var, eid))
Unauthorized: No read acces on AB with eid 979.

prioritynormal
typebug
done in<not specified>
closed by<not specified>