Skip to content

Commit

Permalink
Merge branch '2.2' into 2
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 23, 2024
2 parents 400ea39 + c507a38 commit b2473f9
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 15 deletions.
3 changes: 2 additions & 1 deletion code/Forms/EditorEmailLinkFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace SilverStripe\Admin\Forms;

use SilverStripe\Forms\EmailField;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;
use SilverStripe\Forms\RequiredFields;
Expand All @@ -11,7 +12,7 @@ class EditorEmailLinkFormFactory extends LinkFormFactory
protected function getFormFields($controller, $name, $context)
{
$fields = FieldList::create([
TextField::create(
EmailField::create(
'Link',
_t(__CLASS__.'.EMAIL', 'Email address')
),
Expand Down
14 changes: 0 additions & 14 deletions tests/behat/features/manage-groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ Feature: Manage groups
And I press the "Create" button
Then I should see "Validation Error"

Scenario: Members of a group with permissions
Given I go to "/Security/login"
And I press the "Log in as someone else" button
And I am logged in as a member of "BOB" group
When I go to "/my-page?stage=Stage"
Then I should not see "My page"

Scenario: Members of a group with permissions can edit Group data
Given I go to "/Security/login"
And I press the "Log in as someone else" button
Expand Down Expand Up @@ -68,13 +61,6 @@ Feature: Manage groups
And I click "Users" in the ".breadcrumbs-wrapper" element
And I should see "General Editor"

Scenario: Members of a group with permissions cannot view draft content
Given I go to "/Security/login"
And I press the "Log in as someone else" button
And I am logged in as a member of "BOB" group
When I go to "/my-page?stage=Stage"
Then I should not see "My page"

Scenario: Members of a group without permissions cannot view draft content
Given I go to "/Security/login"
And I press the "Log in as someone else" button
Expand Down
43 changes: 43 additions & 0 deletions tests/behat/features/manage-roles.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@javascript @retry
Feature: Manage Roles
As a site administrator
I want to create and manage group roles on my site
So that I can control access to the CMS

Background:
Given a "group" "Jane"
And the "role" "This role is just another role"
And the "role" "View draft content" has permissions "View draft content"
And the "page" "My page"
And I am logged in with "ADMIN" permissions
And I go to "/admin/security"

Scenario: I can create a new role with permissions
When I click the "Roles" CMS tab
And I press the "Add Role" button
And I fill in "Title" with "MyRole"
And I check "View draft content"
And I press the "Create" button
Then I should not see "Validation Error"
And the "View draft content" checkbox should be checked

Scenario: Manage roles link works correctly
When I click the "Groups" CMS tab
And I click "Jane" in the "#Form_EditForm_groups" element
And I click the "Roles" CMS tab
And I click "Manage roles" in the "#Root_Roles" element
Then I should see "Add Role"
And I should see "This role is just another role"

Scenario: Members of a group with role permissions can view draft content
When I click the "Groups" CMS tab
And I click "Jane" in the "#Form_EditForm_groups" element
And I click the "Roles" CMS tab
And I select "View draft content" from "Roles[]"
And I press the "Save" button
Then I should not see "Validation Error"
Given I go to "/Security/login"
And I press the "Log in as someone else" button
And I am logged in as a member of "Jane" group
When I go to "/my-page?stage=Stage"
Then I should see "My page"

0 comments on commit b2473f9

Please sign in to comment.