PermissionsController::admin_delete PHP Method

admin_delete() public method

[ADMIN] 削除処理
public admin_delete ( $userGroupId, integer $id = null ) : void
$id integer
return void
    public function admin_delete($userGroupId, $id = null)
    {
        $this->_checkSubmitToken();
        /* 除外処理 */
        if (!$id) {
            $this->setMessage('無効なIDです。', true);
            $this->redirect(array('action' => 'index'));
        }
        // メッセージ用にデータを取得
        $post = $this->Permission->read(null, $id);
        /* 削除処理 */
        if ($this->Permission->delete($id)) {
            $this->setMessage('アクセス制限設定「' . $post['Permission']['name'] . '」 を削除しました。', false, true);
        } else {
            $this->setMessage('データベース処理中にエラーが発生しました。', true, false);
        }
        $this->redirect(array('action' => 'index', $userGroupId));
    }