| @@ 11-20 (lines=10) @@ | ||
| 8 | /** |
|
| 9 | * Basic permissions, defaults to page perms where possible |
|
| 10 | */ |
|
| 11 | public function canView($member = null) |
|
| 12 | { |
|
| 13 | if ($page = $this->owner->getPage()) { |
|
| 14 | return $page->canView($member); |
|
| 15 | } |
|
| 16 | ||
| 17 | if(Director::is_cli()) return true; |
|
| 18 | ||
| 19 | return (Permission::check('CMS_ACCESS_CMSMain', 'any', $member)) ? true : null; |
|
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * Basic permissions, defaults to page perms where possible |
|
| @@ 25-34 (lines=10) @@ | ||
| 22 | /** |
|
| 23 | * Basic permissions, defaults to page perms where possible |
|
| 24 | */ |
|
| 25 | public function canEdit($member = null) |
|
| 26 | { |
|
| 27 | if ($page = $this->owner->getPage()) { |
|
| 28 | return $page->canEdit($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 |
|
| @@ 42-51 (lines=10) @@ | ||
| 39 | * i.e if a widget is not published, then it can be deleted by someone who |
|
| 40 | * doesn't have publishing permissions |
|
| 41 | */ |
|
| 42 | public function canDelete($member = null) |
|
| 43 | { |
|
| 44 | if ($page = $this->owner->getPage()) { |
|
| 45 | return $page->canArchive($member); |
|
| 46 | } |
|
| 47 | ||
| 48 | if(Director::is_cli()) return true; |
|
| 49 | ||
| 50 | return (Permission::check('CMS_ACCESS_CMSMain', 'any', $member)) ? true : null; |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Basic permissions, defaults to page perms where possible |
|