Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

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

Open
@Fox32

Description

@Fox32

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions