PageelementPubAction.class.php (548B)
1 <?php 2 namespace cms\action\pageelement; 3 use cms\action\Method; 4 use cms\action\PageelementAction; 5 use cms\model\Permission; 6 use util\exception\SecurityException; 7 8 class PageelementPubAction extends PageelementAction implements Method { 9 10 protected function getRequiredPagePermission() 11 { 12 return Permission::ACL_PUBLISH; 13 } 14 15 public function view() { 16 } 17 public function post() { 18 if ( !$this->page->hasRight( Permission::ACL_PUBLISH ) ) 19 throw new SecurityException( 'no right for publish' ); 20 21 $this->publishPage(); 22 } 23 }