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));
}