Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Remove silverstripe/campaign-admin integration support #482

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/ChangeSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
*/
class ChangeSet extends DataObject
{
private static $singular_name = 'Campaign';
private static $singular_name = 'Changeset';

private static $plural_name = 'Campaigns';
private static $plural_name = 'Changesets';

/** An active changeset */
const STATE_OPEN = 'open';
Expand Down Expand Up @@ -98,15 +98,14 @@ class ChangeSet extends DataObject

/**
* Default permission to require for publishers.
* Publishers must either be able to use the campaign admin, or have all admin access.
* Publishers must have access to all admin access.
*
* Also used as default permission for ChangeSetItem default permission.
*
* @config
* @var array
*/
private static $required_permission = [
'CMS_ACCESS_CampaignAdmin',
'CMS_ACCESS_LeftAndMain'
];

Expand Down Expand Up @@ -635,7 +634,7 @@ public function getStateLabel()
}

/**
* Gets the full name of the user who last published this campaign
* Gets the full name of the user who last published this ChangeSet
*
* @return string
*/
Expand Down
21 changes: 0 additions & 21 deletions tests/php/ChangeSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,19 +351,6 @@ public function testCanPublish()
$this->logInWithPermission('PERM_canPublish');
$this->assertTrue($changeSet->canPublish());

// Test user with the necessary minimum permissions can login
$this->logInWithPermission(
[
'CMS_ACCESS_CampaignAdmin',
'PERM_canPublish'
]
);
$this->assertTrue($changeSet->canPublish());

// campaign admin only permission doesn't grant publishing rights
$this->logInWithPermission('CMS_ACCESS_CampaignAdmin');
$this->assertFalse($changeSet->canPublish());

// Test that you can still publish a changeset, even if canPublish()
// returns false (e.g. externally rather than internally enforced)
$changeSet->publish();
Expand Down Expand Up @@ -448,8 +435,6 @@ public function testCanEdit()
$this->assertFalse($changeSet->canEdit());
$this->logInWithPermission('SomeWrongPermission');
$this->assertFalse($changeSet->canEdit());
$this->logInWithPermission('CMS_ACCESS_CampaignAdmin');
$this->assertTrue($changeSet->canEdit());
}

public function testCanCreate()
Expand All @@ -459,8 +444,6 @@ public function testCanCreate()
$this->assertFalse(ChangeSet::singleton()->canCreate());
$this->logInWithPermission('SomeWrongPermission');
$this->assertFalse(ChangeSet::singleton()->canCreate());
$this->logInWithPermission('CMS_ACCESS_CampaignAdmin');
$this->assertTrue(ChangeSet::singleton()->canCreate());
}

public function testCanDelete()
Expand All @@ -479,8 +462,6 @@ public function testCanDelete()
$this->assertFalse($changeSet->canDelete());
$this->logInWithPermission('SomeWrongPermission');
$this->assertFalse($changeSet->canDelete());
$this->logInWithPermission('CMS_ACCESS_CampaignAdmin');
$this->assertTrue($changeSet->canDelete());
}

public function testCanView()
Expand All @@ -499,8 +480,6 @@ public function testCanView()
$this->assertFalse($changeSet->canView());
$this->logInWithPermission('SomeWrongPermission');
$this->assertFalse($changeSet->canView());
$this->logInWithPermission('CMS_ACCESS_CampaignAdmin');
$this->assertTrue($changeSet->canView());
}

public function testPublish()
Expand Down