Fix `/versions` requests (#17410)
We need it to work on workers and allow guest access. Broke by #17392
This commit is contained in:
parent
1353fb3347
commit
0ed1c64c83
|
@ -0,0 +1 @@
|
|||
Finish up work to allow per-user feature flags.
|
|
@ -74,6 +74,9 @@ from synapse.storage.databases.main.event_push_actions import (
|
|||
EventPushActionsWorkerStore,
|
||||
)
|
||||
from synapse.storage.databases.main.events_worker import EventsWorkerStore
|
||||
from synapse.storage.databases.main.experimental_features import (
|
||||
ExperimentalFeaturesStore,
|
||||
)
|
||||
from synapse.storage.databases.main.filtering import FilteringWorkerStore
|
||||
from synapse.storage.databases.main.keys import KeyStore
|
||||
from synapse.storage.databases.main.lock import LockStore
|
||||
|
@ -155,6 +158,7 @@ class GenericWorkerStore(
|
|||
LockStore,
|
||||
SessionStore,
|
||||
TaskSchedulerWorkerStore,
|
||||
ExperimentalFeaturesStore,
|
||||
):
|
||||
# Properties that multiple storage classes define. Tell mypy what the
|
||||
# expected type is.
|
||||
|
|
|
@ -66,7 +66,12 @@ class VersionsRestServlet(RestServlet):
|
|||
msc3881_enabled = self.config.experimental.msc3881_enabled
|
||||
|
||||
if self.auth.has_access_token(request):
|
||||
requester = await self.auth.get_user_by_req(request)
|
||||
requester = await self.auth.get_user_by_req(
|
||||
request,
|
||||
allow_guest=True,
|
||||
allow_locked=True,
|
||||
allow_expired=True,
|
||||
)
|
||||
user_id = requester.user.to_string()
|
||||
|
||||
msc3881_enabled = await self.store.is_feature_enabled(
|
||||
|
|
Loading…
Reference in New Issue