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