|
@@ 24-34 (lines=11) @@
|
| 21 |
|
/** |
| 22 |
|
* Basic permissions, defaults to page perms where possible |
| 23 |
|
*/ |
| 24 |
|
public function canView($member = null) |
| 25 |
|
{ |
| 26 |
|
if ($page = $this->owner->getPage()) { |
| 27 |
|
|
| 28 |
|
return $page->canView($member); |
| 29 |
|
} |
| 30 |
|
|
| 31 |
|
if(Director::is_cli()) return true; |
| 32 |
|
|
| 33 |
|
return (Permission::check('CMS_ACCESS_CMSMain', 'any', $member)) ? true : null; |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
/** |
| 37 |
|
* Basic permissions, defaults to page perms where possible |
|
@@ 39-48 (lines=10) @@
|
| 36 |
|
/** |
| 37 |
|
* Basic permissions, defaults to page perms where possible |
| 38 |
|
*/ |
| 39 |
|
public function canEdit($member = null) |
| 40 |
|
{ |
| 41 |
|
if ($page = $this->owner->getPage()) { |
| 42 |
|
return $page->canEdit($member); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
if(Director::is_cli()) return true; |
| 46 |
|
|
| 47 |
|
return (Permission::check('CMS_ACCESS_CMSMain', 'any', $member)) ? true : null; |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
/** |
| 51 |
|
* Basic permissions, defaults to page perms where possible |
|
@@ 56-65 (lines=10) @@
|
| 53 |
|
* i.e if a widget is not published, then it can be deleted by someone who |
| 54 |
|
* doesn't have publishing permissions |
| 55 |
|
*/ |
| 56 |
|
public function canDelete($member = null) |
| 57 |
|
{ |
| 58 |
|
if ($page = $this->owner->getPage()) { |
| 59 |
|
return $page->canArchive($member); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
if(Director::is_cli()) return true; |
| 63 |
|
|
| 64 |
|
return (Permission::check('CMS_ACCESS_CMSMain', 'any', $member)) ? true : null; |
| 65 |
|
} |
| 66 |
|
|
| 67 |
|
/** |
| 68 |
|
* Basic permissions, defaults to page perms where possible |