/**
  * Show the form for editing the specified reportgrouping.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($report_id, $id)
 {
     $reportgrouping = ReportGrouping::findOrFail($id);
     if (Request::ajax()) {
         return $this->_ajax_denied();
     }
     if (!$reportgrouping->canUpdate()) {
         return _access_denied();
     }
     $report = Report::findOrFail($report_id);
     return View::make('reportgroupings.edit', compact('reportgrouping', 'report_id', 'report'));
 }
Esempio n. 2
0
/**
 * Show a helpful access-denied page. Has a login ability if it senses that logging in could curtail the error.
 *
 * @param  ID_TEXT		The class of error (e.g. SPECIFIC_PERMISSION)
 * @param  string			The parameteter given to the error message
 * @param  boolean		Force the user to login (even if perhaps they are logged in already)
 */
function access_denied($class, $param = '', $force_login = false)
{
    require_code('failure');
    _access_denied($class, $param, $force_login);
}
 /**
  * Remove the specified permission from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $permission = Permission::findOrFail($id);
     if (!$permission->canDelete()) {
         return _access_denied();
     }
     if (!$permission->delete()) {
         return $this->_delete_error();
     }
     if (Request::ajax()) {
         return Response::json($this->deleted_message);
     }
     return Redirect::route('permissions.index')->with('notification:success', $this->deleted_message);
 }
Esempio n. 4
0
 /**
  * Show the form for editing the specified report.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $report = Report::findOrFail($id);
     if (Request::ajax()) {
         return $this->_ajax_denied();
     }
     if (!$report->canUpdate()) {
         return _access_denied();
     }
     return View::make('reports.edit', compact('report'));
 }