BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
929ab909
Unverified
Commit
929ab909
authored
Nov 16, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group masters should be able to create/close milestones
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
78d542fc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
7 deletions
+9
-7
milestones_controller.rb
app/controllers/groups/milestones_controller.rb
+1
-1
ability.rb
app/models/ability.rb
+1
-0
_milestone.html.haml
app/views/groups/milestones/_milestone.html.haml
+1
-1
index.html.haml
app/views/groups/milestones/index.html.haml
+5
-4
show.html.haml
app/views/groups/milestones/show.html.haml
+1
-1
No files found.
app/controllers/groups/milestones_controller.rb
View file @
929ab909
...
@@ -38,7 +38,7 @@ class Groups::MilestonesController < Groups::ApplicationController
...
@@ -38,7 +38,7 @@ class Groups::MilestonesController < Groups::ApplicationController
private
private
def
authorize_group_milestone!
def
authorize_group_milestone!
return
render_404
unless
can?
(
current_user
,
:admin_
group
,
group
)
return
render_404
unless
can?
(
current_user
,
:admin_
milestones
,
group
)
end
end
def
milestone_params
def
milestone_params
...
...
app/models/ability.rb
View file @
929ab909
...
@@ -233,6 +233,7 @@ class Ability
...
@@ -233,6 +233,7 @@ class Ability
if
group
.
has_master?
(
user
)
||
group
.
has_owner?
(
user
)
||
user
.
admin?
if
group
.
has_master?
(
user
)
||
group
.
has_owner?
(
user
)
||
user
.
admin?
rules
.
push
(
*
[
rules
.
push
(
*
[
:create_projects
,
:create_projects
,
:admin_milestones
])
])
end
end
...
...
app/views/groups/milestones/_milestone.html.haml
View file @
929ab909
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
%span
.label.label-gray
%span
.label.label-gray
=
milestone
.
project
.
name
=
milestone
.
project
.
name
.col-sm-6
.col-sm-6
-
if
can?
(
current_user
,
:admin_
group
,
@group
)
-
if
can?
(
current_user
,
:admin_
milestones
,
@group
)
-
if
milestone
.
closed?
-
if
milestone
.
closed?
=
link_to
'Reopen Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
milestone:
{
state_event: :activate
}),
method: :put
,
class:
"btn btn-xs btn-grouped btn-reopen"
=
link_to
'Reopen Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
milestone:
{
state_event: :activate
}),
method: :put
,
class:
"btn btn-xs btn-grouped btn-reopen"
-
else
-
else
...
...
app/views/groups/milestones/index.html.haml
View file @
929ab909
...
@@ -3,10 +3,11 @@
...
@@ -3,10 +3,11 @@
=
render
'shared/milestones_filter'
=
render
'shared/milestones_filter'
.gray-content-block
.gray-content-block
.pull-right
-
if
can?
(
current_user
,
:admin_milestones
,
@group
)
%span
.pull-right.hidden-xs
.pull-right
=
link_to
new_group_milestone_path
(
@group
),
class:
"btn btn-new"
do
%span
.pull-right.hidden-xs
New Milestone
=
link_to
new_group_milestone_path
(
@group
),
class:
"btn btn-new"
do
New Milestone
.oneline
.oneline
Only milestones from
Only milestones from
...
...
app/views/groups/milestones/show.html.haml
View file @
929ab909
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
Open
Open
Milestone
#{
@milestone
.
title
}
Milestone
#{
@milestone
.
title
}
.pull-right
.pull-right
-
if
can?
(
current_user
,
:admin_
group
,
@group
)
-
if
can?
(
current_user
,
:admin_
milestones
,
@group
)
-
if
@milestone
.
active?
-
if
@milestone
.
active?
=
link_to
'Close Milestone'
,
group_milestone_path
(
@group
,
@milestone
.
safe_title
,
title:
@milestone
.
title
,
milestone:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-sm btn-close"
=
link_to
'Close Milestone'
,
group_milestone_path
(
@group
,
@milestone
.
safe_title
,
title:
@milestone
.
title
,
milestone:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-sm btn-close"
-
else
-
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment