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

Provide extension point to provide a custom set of power levels to role label mapping #6

Open
Fox32 opened this issue Sep 1, 2022 · 4 comments

Comments

@Fox32
Copy link

Fox32 commented Sep 1, 2022

Is your feature request related to a problem? Please describe.

We have custom requirements of introducing more "roles" to Element. In general the power level model is quite flexible when it comes to custom setups. However, in this case it is important that the user can see a name and not just a custom power level in the UI. This affects the following parts of the UI:

  • Role selection:
    Bildschirmfoto 2022-09-01 um 14 43 06
  • Labels on peoples list of a room:
    image
  • Permissions Settings Dialog:
    image

I may have missed a part of the UI.

Describe the solution you'd like

The module system provides a hook that we can override. If it is overridden, the module is responsible for returning a map of roles to translated labels. The matrix-react-sdk calls this hook whenever it needs to resolve a power level to a role, or displays a role selection dropdown.

Right now it is used in multiple places which define multiple power level to role maps:

All these places have to use the new hook of the module system to get the map of power level to role mapping.

Describe alternatives you've considered

Currently we achieve this changes by forking Element and the matrix-react-sdk, however, to resolve the fork, we want to move it to the module system.

I would also be open to add it to the matrix-react-sdk itself, but I see the problem that new roles would require custom translatable labels, which the module system already supports. So I think it is a better fit here.

There are also ideas to extend this to be user customizable per room element-hq/element-meta#87, however our primary goal is to make it a global configuration. But one can interpret the feature request also as introducing groups. Here I still wonder how to make it translatable. We could change the default room events to include this custom configuration in every room we create.

Additional context

@turt2live
Copy link
Member

For clarity, are you looking to add new mappings or just change the labels?

@Fox32
Copy link
Author

Fox32 commented Sep 2, 2022

We want to add additional mappings.

We also have the case to rename them, but that case ist already supported by the
module system 🙂

@Fox32
Copy link
Author

Fox32 commented Nov 2, 2022

We are currently opposed to bringing this feature to the module system.

While it would help us short term to support the custom roles, it won't work on other apps like Element Android or iOS. Therefore we need a more "standard" approach that is part of the spec. So a solution like element-hq/element-meta#87 or matrix-org/matrix-spec-proposals#2812 would be a better solution for us.

@Fox32
Copy link
Author

Fox32 commented Dec 20, 2022

matrix-org/matrix-spec-proposals#3949 might be a good alternative.

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

No branches or pull requests

2 participants