Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
59dc1034
Commit
59dc1034
authored
13 years ago
by
Holger Just
Browse files
Options
Downloads
Patches
Plain Diff
[#735] Don't allow time entry creation with only edit permission
Based on a patch by Jean-Philippe Lang.
parent
c5b83b87
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/redmine.rb
+2
-2
2 additions, 2 deletions
lib/redmine.rb
test/functional/timelog_controller_test.rb
+12
-0
12 additions, 0 deletions
test/functional/timelog_controller_test.rb
with
14 additions
and
2 deletions
lib/redmine.rb
+
2
−
2
View file @
59dc1034
...
...
@@ -102,8 +102,8 @@ Redmine::AccessControl.map do |map|
map
.
project_module
:time_tracking
do
|
map
|
map
.
permission
:log_time
,
{
:timelog
=>
[
:new
,
:create
]},
:require
=>
:loggedin
map
.
permission
:view_time_entries
,
:timelog
=>
[
:index
,
:show
],
:time_entry_reports
=>
[
:report
]
map
.
permission
:edit_time_entries
,
{
:timelog
=>
[
:new
,
:create
,
:edit
,
:update
,
:destroy
]},
:require
=>
:member
map
.
permission
:edit_own_time_entries
,
{
:timelog
=>
[
:new
,
:create
,
:edit
,
:update
,
:destroy
]},
:require
=>
:loggedin
map
.
permission
:edit_time_entries
,
{
:timelog
=>
[
:edit
,
:update
,
:destroy
]},
:require
=>
:member
map
.
permission
:edit_own_time_entries
,
{
:timelog
=>
[
:edit
,
:update
,
:destroy
]},
:require
=>
:loggedin
map
.
permission
:manage_project_activities
,
{
:project_enumerations
=>
[
:update
,
:destroy
]},
:require
=>
:member
end
...
...
This diff is collapsed.
Click to expand it.
test/functional/timelog_controller_test.rb
+
12
−
0
View file @
59dc1034
...
...
@@ -111,6 +111,18 @@ class TimelogControllerTest < ActionController::TestCase
assert_equal
3
,
t
.
user_id
end
def
test_create_without_log_time_permission_should_be_denied
@request
.
session
[
:user_id
]
=
2
Role
.
find_by_name
(
'Manager'
).
remove_permission!
:log_time
post
:create
,
:project_id
=>
1
,
:time_entry
=>
{
:activity_id
=>
'11'
,
:issue_id
=>
''
,
:spent_on
=>
'2008-03-14'
,
:hours
=>
'7.3'
}
assert_response
403
end
def
test_update
entry
=
TimeEntry
.
find
(
1
)
assert_equal
1
,
entry
.
issue_id
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment