Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40884

Allow form fields to be locked by capability checks

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • Future Dev
    • Forms Library, Usability

      We could have an option in formslib to lock some fields of a form depending on the capabilities that the current user has.

      Firstly, this prevents a mix of if/else in the form definition.
      Secondly, we can provide a template for such type of "lock" to represent them visually.
      Thirdly, we provide a standard way of locking a field, which leads to more consistency throughout the forms.

      While chatting with Dan about it, we have to keep in mind that this is not an option to hide fields from the user and should not be use with that purpose in mind. Some fields must be hidden, maybe we could also have an option to hard freeze an option when the user is not supposed to see it.

      I am attaching a quick patch, and a screenshot, as a proof of concept.

            Unassigned Unassigned
            fred Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.