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
8671f35c
Commit
8671f35c
authored
Aug 29, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prepare boards responses module for backport
parent
7a7bcc1f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
37 deletions
+50
-37
app/controllers/boards/issues_controller.rb
app/controllers/boards/issues_controller.rb
+2
-1
app/controllers/boards/lists_controller.rb
app/controllers/boards/lists_controller.rb
+2
-1
app/controllers/concerns/boards_responses.rb
app/controllers/concerns/boards_responses.rb
+42
-0
app/controllers/projects/boards_controller.rb
app/controllers/projects/boards_controller.rb
+2
-1
ee/app/controllers/ee/boards_responses.rb
ee/app/controllers/ee/boards_responses.rb
+0
-33
ee/app/controllers/groups/boards_controller.rb
ee/app/controllers/groups/boards_controller.rb
+2
-1
No files found.
app/controllers/boards/issues_controller.rb
View file @
8671f35c
module
Boards
class
IssuesController
<
Boards
::
ApplicationController
include
EE
::
BoardsResponses
prepend
EE
::
BoardsResponses
prepend
EE
::
Boards
::
IssuesController
include
BoardsResponses
before_action
:authorize_read_issue
,
only:
[
:index
]
before_action
:authorize_create_issue
,
only:
[
:create
]
...
...
app/controllers/boards/lists_controller.rb
View file @
8671f35c
module
Boards
class
ListsController
<
Boards
::
ApplicationController
include
EE
::
BoardsResponses
prepend
EE
::
BoardsResponses
include
BoardsResponses
before_action
:authorize_admin_list
,
only:
[
:create
,
:update
,
:destroy
,
:generate
]
before_action
:authorize_read_list
,
only:
[
:index
]
...
...
app/controllers/concerns/boards_responses.rb
0 → 100644
View file @
8671f35c
module
BoardsResponses
def
authorize_read_list
authorize_action_for!
(
board
.
parent
,
:read_list
)
end
def
authorize_read_issue
authorize_action_for!
(
board
.
parent
,
:read_issue
)
end
def
authorize_update_issue
authorize_action_for!
(
issue
,
:admin_issue
)
end
def
authorize_create_issue
authorize_action_for!
(
project
,
:admin_issue
)
end
def
authorize_admin_list
authorize_action_for!
(
board
.
parent
,
:admin_list
)
end
def
authorize_action_for!
(
resource
,
ability
)
return
render_403
unless
can?
(
current_user
,
ability
,
resource
)
end
def
respond_with_boards
respond_with
(
@boards
)
end
def
respond_with_board
respond_with
(
@board
)
end
def
respond_with
(
resource
)
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
serialize_as_json
(
resource
)
end
end
end
end
app/controllers/projects/boards_controller.rb
View file @
8671f35c
class
Projects::BoardsController
<
Projects
::
ApplicationController
prepend
EE
::
Boards
::
BoardsController
prepend
EE
::
BoardsResponses
include
BoardsResponses
include
IssuableCollections
include
EE
::
BoardsResponses
before_action
:authorize_read_board!
,
only:
[
:index
,
:show
]
before_action
:assign_endpoint_vars
...
...
ee/app/controllers/ee/boards_responses.rb
View file @
8671f35c
...
...
@@ -13,38 +13,5 @@ module EE
authorize_action_for!
(
board
.
parent
,
ability
)
end
def
authorize_update_issue
authorize_action_for!
(
issue
,
:admin_issue
)
end
def
authorize_create_issue
authorize_action_for!
(
project
,
:admin_issue
)
end
def
authorize_admin_list
authorize_action_for!
(
board
.
parent
,
:admin_list
)
end
def
authorize_action_for!
(
resource
,
ability
)
return
render_403
unless
can?
(
current_user
,
ability
,
resource
)
end
def
respond_with_boards
respond_with
(
@boards
)
end
def
respond_with_board
respond_with
(
@board
)
end
def
respond_with
(
resource
)
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
serialize_as_json
(
resource
)
end
end
end
end
end
ee/app/controllers/groups/boards_controller.rb
View file @
8671f35c
class
Groups::BoardsController
<
Groups
::
ApplicationController
prepend
EE
::
Boards
::
BoardsController
include
EE
::
BoardsResponses
prepend
EE
::
BoardsResponses
include
BoardsResponses
before_action
:check_group_issue_boards_available!
before_action
:assign_endpoint_vars
...
...
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