Bug #84214
closedEpic #85006: Reduce falsely reported broken links
Linkvalidator should not check records without write permissions
100%
Description
By default, all broken links in records for which the editor has read access (perms=1) are displayed. I think this should be changed to read / write (perms=3): It does not make sense for the editor to be displayed lists of broken links he can't do anything about because he does not have write permsission to the records.
Reproduce¶
Set permissions so a specific user does not have write access to content but can view the page in page tree. The page has one or more broken links. Check for broken links has already been performed
- Set permission for page: other user and same group as user (e.g. simple editor)
- Set permissions so group can only show page (not edit content)
- Open report for broken links
- Start to edit a broken link by clicking on pencil symbol
Error message:
Sorry, you didn't have proper permissions to perform this change. No content edit permission for user 2 on page 104 1437679657
Solution¶
Must check if editor can edit the table.field:
- for table_name = 'pages' : check if page is editable
- for table_name not 'pages' check if content is editable
Additionally:
- the specific field must be editable for the users, e.g. for pages.canonical_link : this must be editable by the user / group (see exclude fields)
BackendUserAuthentication::isRTE() : is RTE enable for the user (for RTE fields)- this is not necessary, even if RTE is disabled, editor can still edit the field- might also have to check if editing a translation is allowed for the user if the record is in non default language
Also might have to consider in the future:
(BackendUserAuthentication::isInWebMount() to check if page is in webmount) - only if complete list is displayed regardless of currently selected page which is currently not the case
Files