Drupal's permissions page does reorder. Within a single module's group, core's PermissionHandler sorts permissions alphabetically by their title. But it ignores the order how they're defined in the .permissions.yml or elsewhere. So any try to push an order, which makes more sense in certain fields, has no effect on what you see. Drupal renders one flat list A→Z by title. From a UX perspective this can become a risky overview where an administrator or allowed site manager can easily oversee the scope of a permission sitting on the wrong place.

So while "forcing" the exact order isn't possible through normal means yet, the only way to force it is an ugly hack (numeric prefixes like "01 …" baked into each title. I would not recommend that and would like to discuss if we can not support order in Drupal core.

Nice to have in addition to sorting would be to be able to visually sub-group permissions. Not sure if core should provide a very easily becoming opiniated functionality of diverse free sub-grouping, which starts to become a back an forth of best ways to group very quick (I do not think so).

But maybe we can give 2-3 minor options (allowed keys) at hand to allow grouping. Like administer/manage group or view/edit/delete group. YAML perfectly supports that if Drupal is able to handle the keys.

Sh/Could be part of (added): #1765576: Redesign the permissions page

Comments

dqd created an issue. See original summary.

dqd’s picture

Title: Allow custom order of permissions like proposed » Allow custom order of permissions and sub grouping