コード例 #1
0
 /**
  * beforeFilter
  *
  * @return void
  * @throws ForbiddenException
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow();
     //Roleのデータをviewにセット
     if (!$this->NetCommonsRoomRole->setView($this)) {
         throw new ForbiddenException(__d('net_commons', 'Security Error! Unauthorized input.'));
     }
     //編集権限チェック
     if (!$this->viewVars['pageEditable']) {
         throw new ForbiddenException();
     }
 }
コード例 #2
0
 /**
  * beforeFilter
  *
  * @return void
  * @throws ForbiddenException
  **/
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow();
     $frameId = isset($this->params['pass'][0]) ? (int) $this->params['pass'][0] : 0;
     //Frameのデータをviewにセット
     if (!$this->NetCommonsFrame->setView($this, $frameId)) {
         throw new ForbiddenException(__d('net_commons', 'Security Error! Unauthorized input.'));
     }
     //Roleのデータをviewにセット
     if (!$this->NetCommonsRoomRole->setView($this)) {
         throw new ForbiddenException(__d('net_commons', 'Security Error! Unauthorized input.'));
     }
 }