function WorkflowCustomAccessType::defaultConfiguration

Same name and namespace in other branches
  1. 9 core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/WorkflowCustomAccessType.php \Drupal\workflow_type_test\Plugin\WorkflowType\WorkflowCustomAccessType::defaultConfiguration()
  2. 8.9.x core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/WorkflowCustomAccessType.php \Drupal\workflow_type_test\Plugin\WorkflowType\WorkflowCustomAccessType::defaultConfiguration()
  3. 10 core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/WorkflowCustomAccessType.php \Drupal\workflow_type_test\Plugin\WorkflowType\WorkflowCustomAccessType::defaultConfiguration()

Overrides WorkflowTypeBase::defaultConfiguration

File

core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/WorkflowCustomAccessType.php, line 24

Class

WorkflowCustomAccessType
A test workflow with custom state/transition access rules applied.

Namespace

Drupal\workflow_type_test\Plugin\WorkflowType

Code

public function defaultConfiguration() {
    return [
        'states' => [
            'cannot_update' => [
                'label' => 'Cannot Update State',
                'weight' => 0,
            ],
            'cannot_delete' => [
                'label' => 'Cannot Delete State',
                'weight' => 0,
            ],
        ],
        'transitions' => [
            'cannot_update' => [
                'label' => 'Cannot Update Transition',
                'to' => 'cannot_update',
                'weight' => 0,
                'from' => [
                    'cannot_update',
                ],
            ],
            'cannot_delete' => [
                'label' => 'Cannot Delete Transition',
                'to' => 'cannot_delete',
                'weight' => 1,
                'from' => [
                    'cannot_delete',
                ],
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.