Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
846cec83
Commit
846cec83
authored
Jul 25, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes to projects boards
parent
a424d173
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
11 deletions
+12
-11
app/assets/javascripts/boards/services/board_service.js
app/assets/javascripts/boards/services/board_service.js
+0
-2
app/controllers/boards/lists_controller.rb
app/controllers/boards/lists_controller.rb
+3
-7
app/controllers/concerns/boards_authorizations.rb
app/controllers/concerns/boards_authorizations.rb
+7
-0
app/helpers/boards_helper.rb
app/helpers/boards_helper.rb
+1
-1
app/models/ee/board.rb
app/models/ee/board.rb
+1
-1
No files found.
app/assets/javascripts/boards/services/board_service.js
View file @
846cec83
...
...
@@ -4,8 +4,6 @@ import Vue from 'vue';
class
BoardService
{
constructor
(
root
,
listsEndpoint
,
bulkUpdatePath
,
boardId
)
{
// alert(listsEndpoint)
// alert(root)
this
.
boards
=
Vue
.
resource
(
`
${
root
}
{/id}.json`
,
{},
{
issues
:
{
method
:
'
GET
'
,
...
...
app/controllers/boards/lists_controller.rb
View file @
846cec83
...
...
@@ -2,7 +2,7 @@ module Boards
class
ListsController
<
Boards
::
ApplicationController
include
BoardsAuthorizations
#
before_action :authorize_admin_list!, only: [:create, :update, :destroy, :generate]
before_action
:authorize_admin_list!
,
only:
[
:create
,
:update
,
:destroy
,
:generate
]
before_action
:authorize_read_list!
,
only:
[
:index
]
def
index
...
...
@@ -12,7 +12,7 @@ module Boards
end
def
create
list
=
::
Boards
::
Lists
::
CreateService
.
new
(
projec
t
,
current_user
,
list_params
).
execute
(
board
)
list
=
::
Boards
::
Lists
::
CreateService
.
new
(
board
.
paren
t
,
current_user
,
list_params
).
execute
(
board
)
if
list
.
valid?
render
json:
serialize_as_json
(
list
)
...
...
@@ -23,7 +23,7 @@ module Boards
def
update
list
=
board
.
lists
.
movable
.
find
(
params
[
:id
])
service
=
Boards
::
Lists
::
MoveService
.
new
(
projec
t
,
current_user
,
move_params
)
service
=
Boards
::
Lists
::
MoveService
.
new
(
board_paren
t
,
current_user
,
move_params
)
if
service
.
execute
(
list
)
head
:ok
...
...
@@ -55,10 +55,6 @@ module Boards
private
def
authorize_admin_list!
return
render_403
unless
can?
(
current_user
,
:admin_list
,
project
)
end
def
list_params
params
.
require
(
:list
).
permit
(
:label_id
)
end
...
...
app/controllers/concerns/boards_authorizations.rb
View file @
846cec83
...
...
@@ -21,6 +21,13 @@ module BoardsAuthorizations
return
render_403
unless
action_allowed_for?
(
board
.
parent
,
:admin_issue
)
end
def
authorize_admin_list!
ability
=
board
.
is_group_board?
?
:admin_milestones
:
:admin_list
return
render_403
unless
action_allowed_for?
(
board
.
parent
,
ability
)
end
def
action_allowed_for?
(
resource
,
ability
)
can?
(
current_user
,
ability
,
resource
)
end
...
...
app/helpers/boards_helper.rb
View file @
846cec83
...
...
@@ -9,7 +9,7 @@ module BoardsHelper
lists_endpoint:
board_lists_path
(
board
),
board_id:
board
.
id
,
board_milestone_title:
board
&
.
milestone
&
.
title
,
disabled:
"
#{
!
can?
(
current_user
,
:admin_list
,
@project
)
}
"
,
# Create this permission for groups( if needed )
disabled:
"
#{
!
can?
(
current_user
,
:admin_list
,
@project
)
}
"
,
issue_link_base:
@issues_path
,
root_path:
root_path
,
bulk_update_path:
@bulk_issues_path
,
...
...
app/models/ee/board.rb
View file @
846cec83
...
...
@@ -22,7 +22,7 @@ module EE
end
def
parent
group
||
project
@parent
||=
group
||
project
end
def
is_group_board?
...
...
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