Role hiding assumption is too optimistik

Created on 3 April 2024, 3 months ago

Problem/Motivation

JS toggle implementation assumes the two first roles are always anonymous and registered user, but roles are sortable and I just ran into a case where the assumption is wrong, so that "Authenticated user" role (and thereby all other roles) are hidden!

toggle: function toggle() {
      var isAuthChecked = $('#edit-roles-authenticated').is(':checked');
      // Removing first 2 options, as they will always be Anon and Auth roles.
      $('.js-form-item.js-form-type-checkbox').slice(2).each(function () {
        this.style.display = isAuthChecked ? 'none' : '';
      });
    }

Steps to reproduce

Proposed resolution

Exclude the "anonymous" and "authenticated" user role by key

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024