mirror of
https://github.com/redmine/redmine.git
synced 2025-11-14 09:16:02 +01:00
Merged r15955 and r15956 (#24297).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@15999 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -19,6 +19,7 @@ class TimelogController < ApplicationController
|
||||
menu_item :issues
|
||||
|
||||
before_filter :find_time_entry, :only => [:show, :edit, :update]
|
||||
before_filter :check_editability, :only => [:edit, :update]
|
||||
before_filter :find_time_entries, :only => [:bulk_edit, :bulk_update, :destroy]
|
||||
before_filter :authorize, :only => [:show, :edit, :update, :bulk_edit, :bulk_update, :destroy]
|
||||
|
||||
@@ -222,13 +223,16 @@ class TimelogController < ApplicationController
|
||||
private
|
||||
def find_time_entry
|
||||
@time_entry = TimeEntry.find(params[:id])
|
||||
@project = @time_entry.project
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
|
||||
def check_editability
|
||||
unless @time_entry.editable_by?(User.current)
|
||||
render_403
|
||||
return false
|
||||
end
|
||||
@project = @time_entry.project
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
|
||||
def find_time_entries
|
||||
|
||||
Reference in New Issue
Block a user