Add the "use keysave" permission to the Keysave module to be able to control access by user roles

Created on 26 May 2024, 6 months ago

Problem/Motivation

Having no way to limit the use of ctl-s for not logged in users.
the Keysave library will be loaded on all pages, not only logged editing or back-end pages

Steps to reproduce

Scenario: The Webform for not logged in user.
Give that a visitor landed on a Contact us page
And the contact us was built with the webform module
When the visitor hit ctl-s
Then the page will submit

Scenario: The content filter form in public pages.
Give that a visitor landed on a page with content
And the content view has number of filters with a submit and reset buttons
When the visitor hit ctl-s
Then the page will submit

Scenario: When having custom forms with submit.

Proposed resolution

  • Add the "use keysave" permission to be able to control access by user roles.
  • Wrap the logic and attaching of the keysave library with if (\Drupal::currentUser()->hasPermission('use keysave')) {

Remaining tasks

  • File an issue
  • MR/Patch
  • Test
  • Review

User interface changes

API changes

Data model changes

Feature request
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024