Merge pull request #3878 from tomhughes/issues-offline

Add database checks to issue and report controllers
This commit is contained in:
Andy Allan 2023-01-11 15:36:40 +00:00 committed by GitHub
commit 088ccd2d8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -3,9 +3,12 @@ class IssueCommentsController < ApplicationController
before_action :authorize_web
before_action :set_locale
before_action :check_database_readable
authorize_resource
before_action :check_database_writable, :only => [:create]
def create
@issue = Issue.find(params[:issue_id])
comment = @issue.comments.build(issue_comment_params)

View file

@ -3,10 +3,12 @@ class IssuesController < ApplicationController
before_action :authorize_web
before_action :set_locale
before_action :check_database_readable
authorize_resource
before_action :find_issue, :only => [:show, :resolve, :reopen, :ignore]
before_action :check_database_writable, :only => [:resolve, :ignore, :reopen]
def index
@title = t ".title"

View file

@ -3,9 +3,12 @@ class ReportsController < ApplicationController
before_action :authorize_web
before_action :set_locale
before_action :check_database_readable
authorize_resource
before_action :check_database_writable, :only => [:new, :create]
def new
if required_new_report_params_present?
@report = Report.new