@@ -5,6 +5,7 @@
Loading
5 5
use SilverStripe\Forms\FormField;
6 6
use SilverStripe\ORM\CMSPreviewable;
7 7
use SilverStripe\ORM\DataObject;
8 +
use SilverStripe\Security\Security;
8 9
9 10
class HistoryViewerField extends FormField
10 11
{
@@ -64,6 +65,13 @@
Loading
64 65
        return $previewEnabled;
65 66
    }
66 67
68 +
    private function getIsRevertable()
69 +
    {
70 +
        $record = $this->getSourceRecord();
71 +
        $member = Security::getCurrentUser();
72 +
        return $record->canEdit($member);
73 +
    }
74 +
67 75
    public function getContextKey()
68 76
    {
69 77
        if ($this->contextKey) {
@@ -96,6 +104,7 @@
Loading
96 104
            'recordClass' => $sourceRecord ? $sourceRecord->ClassName : null,
97 105
            'contextKey' => $this->getContextKey(),
98 106
            'isPreviewable' => $this->getPreviewEnabled(),
107 +
            'isRevertable' => $this->getIsRevertable(),
99 108
            'limit' => $this->config()->get('default_page_size'),
100 109
            'offset' => 0,
101 110
            'page' => 0,
Files Complexity Coverage
src 171 42.63%
Project Totals (13 files) 171 42.63%
432.3
10=-f0
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading