diff --git a/deploy.install b/deploy.install index e69de29..631269f 100644 --- a/deploy.install +++ b/deploy.install @@ -0,0 +1,8 @@ +hasPermission('Deploy to ' . $upstream_workspace_pointer->label()) ) { + if (!$upstream_workspace_pointer || !$account->hasPermission('Deploy to ' . $upstream_workspace_pointer->label())) { $access = AccessResult::forbidden(); } return $access; diff --git a/src/Tests/ReplicationEntityTest.php b/src/Tests/ReplicationEntityTest.php index 494b363..2757355 100644 --- a/src/Tests/ReplicationEntityTest.php +++ b/src/Tests/ReplicationEntityTest.php @@ -22,6 +22,7 @@ class ReplicationEntityTest extends WebTestBase { $this->webUser = $this->drupalCreateUser([ 'administer workspaces', 'administer deployments', + 'Deploy to Live', ]); $this->drupalLogin($this->webUser); diff --git a/tests/src/Functional/WorkspaceConflictReportingTest.php b/tests/src/Functional/WorkspaceConflictReportingTest.php index 4d06d9b..1c878be 100644 --- a/tests/src/Functional/WorkspaceConflictReportingTest.php +++ b/tests/src/Functional/WorkspaceConflictReportingTest.php @@ -61,6 +61,8 @@ class WorkspaceConflictReportingTest extends BrowserTestBase { 'administer content types', 'administer workspaces', 'administer deployments', + 'Deploy to Live', + 'Deploy to Stage', ]; $node_type = NodeType::create(['type' => 'test', 'label' => 'Test']);