fromholdio/silverstripe-no-edit-message

Display friendly message in CMS on pages where user has no edit perm, rather than read-only form.

Installs: 41

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

pkg:composer/fromholdio/silverstripe-no-edit-message

2.0.0 2025-09-20 11:13 UTC

This package is auto-updated.

Last update: 2025-09-20 11:13:58 UTC


README

Display friendly message in CMS on pages where user has no edit perm, rather than read-only form.

Includes replacing page History interface with message too.

To implement:

Page:
  is_no_edit_message_enabled: true    # default: true

And the following must be added to your Page

public function getCMSFields()
{
    if ($this->doShowNoEditMessage() && Controller::curr() instanceof LeftAndMain) {
        return $this->getNoEditCMSFields();
    }
    
    # ... any other regular code.
}

public function getSettingsFields()
{
    if ($this->doShowNoEditMessage() && Controller::curr() instanceof LeftAndMain) {
        return $this->getNoEditCMSFields();
    }
    
    # ... any other regular code.
}

Hooks are in place to amend the message, the tab path and fields, and even the trigger for when to display this (OOTB this applies when canEdit is false).