Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_user_admin Module API returns wrong result when the experimental MSC3861 implementation is enabled #17485

Open
anoadragon453 opened this issue Jul 25, 2024 · 0 comments

Comments

@anoadragon453
Copy link
Member

When the experimental MSC3861 implementation is enabled through the experimental_features.msc3891 option, user authentication is delegated to an external auth provider.

The is_user_admin module API method is used by Synapse modules to determine whether the user making a request is a Synapse Admin or not. Currently, this method only checks the local DB to see if a user is an admin:

async def is_user_admin(self, user_id: str) -> bool:
"""Checks if a user is a server admin.
Added in Synapse v1.39.0.
Args:
user_id: The Matrix ID of the user to check.
Returns:
True if the user is a server admin, False otherwise.
"""
return await self._store.is_server_admin(UserID.from_string(user_id))

If MSC3861 support is enabled, users who are admins will have their requests rejected by Synapse modules which use this method to gate access to endpoints.

Experimental MSC3861 support was implemented in Synapse in matrix-org/synapse#15582.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants