mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
FIX Content editor group users can now insert links into contents while using subsites
This commit is contained in:
parent
fbd98ff402
commit
9dbdd992f7
@ -221,9 +221,11 @@ class LeftAndMainSubsites extends LeftAndMainExtension
|
|||||||
// Admin can access everything, no point in checking.
|
// Admin can access everything, no point in checking.
|
||||||
$member = Security::getCurrentUser();
|
$member = Security::getCurrentUser();
|
||||||
if ($member
|
if ($member
|
||||||
&& (Permission::checkMember($member, 'ADMIN') // 'Full administrative rights'
|
&& (Permission::checkMember($member, [
|
||||||
|| Permission::checkMember($member, 'CMS_ACCESS_LeftAndMain') // 'Access to all CMS sections'
|
'ADMIN', // Full administrative rights
|
||||||
)
|
'CMS_ACCESS_LeftAndMain', // Access to all CMS sections
|
||||||
|
'CMS_ACCESS_CMSMain', // Access to CMS controllers
|
||||||
|
]))
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
29
tests/behat/features/insert-content-link.feature
Normal file
29
tests/behat/features/insert-content-link.feature
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# See https://github.com/silverstripe/silverstripe-subsites/issues/357
|
||||||
|
Feature: Insert an internal link into content
|
||||||
|
As a CMS user
|
||||||
|
I can insert internal links into my content
|
||||||
|
So that I can direct users to different parts of my website
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given a "subsite" "Subsite B"
|
||||||
|
And a "page" "My page" with "URLSegment"="my-page", "Content"="My page content"
|
||||||
|
And a "page" "Another page" with "URLSegment"="another-page", "Content"="My other page content"
|
||||||
|
And I am logged in with "CMS_ACCESS_CMSMain" permissions
|
||||||
|
Then I go to "admin/pages"
|
||||||
|
And I click on "My page" in the tree
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: I can insert an internal link
|
||||||
|
# See "insert-a-link.feature" from silverstripe/cms
|
||||||
|
When I select "My page" in the "Content" HTML field
|
||||||
|
And I press the "Insert link" HTML field button
|
||||||
|
And I click "Page on this site" in the ".mce-menu" element
|
||||||
|
Then I should see an "form#Form_editorInternalLink" element
|
||||||
|
When I click "(Choose Page)" in the ".Select-multi-value-wrapper" element
|
||||||
|
And I click "Another page" in the ".treedropdownfield__menu" element
|
||||||
|
And I fill in "my desc" for "Link description"
|
||||||
|
And I press the "Insert" button
|
||||||
|
Then the "Content" HTML field should contain "<a title="my desc" href="[sitetree_link"
|
||||||
|
And the "Content" HTML field should contain "My page</a>"
|
||||||
|
# Required to avoid "unsaved changes" browser dialog
|
||||||
|
Then I press the "Save" button
|
Loading…
x
Reference in New Issue
Block a user