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
22439322
Commit
22439322
authored
Aug 30, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs and fix boards visibility for public groups
parent
b5510ac8
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
9 deletions
+20
-9
app/controllers/boards/issues_controller.rb
app/controllers/boards/issues_controller.rb
+1
-0
app/controllers/boards/lists_controller.rb
app/controllers/boards/lists_controller.rb
+1
-0
app/policies/group_policy.rb
app/policies/group_policy.rb
+11
-2
app/services/boards/lists/create_service.rb
app/services/boards/lists/create_service.rb
+1
-1
app/services/boards/lists/destroy_service.rb
app/services/boards/lists/destroy_service.rb
+1
-1
app/services/boards/lists/generate_service.rb
app/services/boards/lists/generate_service.rb
+1
-1
app/services/boards/lists/list_service.rb
app/services/boards/lists/list_service.rb
+1
-1
app/services/boards/lists/move_service.rb
app/services/boards/lists/move_service.rb
+1
-1
spec/ee/spec/services/boards/issues/move_service_spec.rb
spec/ee/spec/services/boards/issues/move_service_spec.rb
+1
-1
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+1
-1
No files found.
app/controllers/boards/issues_controller.rb
View file @
22439322
...
@@ -7,6 +7,7 @@ module Boards
...
@@ -7,6 +7,7 @@ module Boards
before_action
:authorize_read_issue
,
only:
[
:index
]
before_action
:authorize_read_issue
,
only:
[
:index
]
before_action
:authorize_create_issue
,
only:
[
:create
]
before_action
:authorize_create_issue
,
only:
[
:create
]
before_action
:authorize_update_issue
,
only:
[
:update
]
before_action
:authorize_update_issue
,
only:
[
:update
]
skip_before_action
:authenticate_user!
,
only:
[
:index
]
def
index
def
index
issues
=
Boards
::
Issues
::
ListService
.
new
(
board_parent
,
current_user
,
filter_params
).
execute
issues
=
Boards
::
Issues
::
ListService
.
new
(
board_parent
,
current_user
,
filter_params
).
execute
...
...
app/controllers/boards/lists_controller.rb
View file @
22439322
...
@@ -5,6 +5,7 @@ module Boards
...
@@ -5,6 +5,7 @@ module Boards
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
]
before_action
:authorize_read_list
,
only:
[
:index
]
skip_before_action
:authenticate_user!
,
only:
[
:index
]
def
index
def
index
lists
=
Boards
::
Lists
::
ListService
.
new
(
board
.
parent
,
current_user
).
execute
(
board
)
lists
=
Boards
::
Lists
::
ListService
.
new
(
board
.
parent
,
current_user
).
execute
(
board
)
...
...
app/policies/group_policy.rb
View file @
22439322
...
@@ -24,9 +24,18 @@ class GroupPolicy < BasePolicy
...
@@ -24,9 +24,18 @@ class GroupPolicy < BasePolicy
with_options
scope: :subject
,
score:
0
with_options
scope: :subject
,
score:
0
condition
(
:request_access_enabled
)
{
@subject
.
request_access_enabled
}
condition
(
:request_access_enabled
)
{
@subject
.
request_access_enabled
}
rule
{
public_group
}
.
enable
:read_group
rule
{
public_group
}.
policy
do
enable
:read_group
enable
:read_list
end
rule
{
logged_in_viewable
}.
enable
:read_group
rule
{
logged_in_viewable
}.
enable
:read_group
rule
{
guest
}
.
enable
:read_group
rule
{
guest
}.
policy
do
enable
:read_group
enable
:read_list
end
rule
{
admin
}
.
enable
:read_group
rule
{
admin
}
.
enable
:read_group
rule
{
has_projects
}
.
enable
:read_group
rule
{
has_projects
}
.
enable
:read_group
...
...
app/services/boards/lists/create_service.rb
View file @
22439322
module
Boards
module
Boards
module
Lists
module
Lists
class
CreateService
<
BaseService
class
CreateService
<
B
oards
::
B
aseService
prepend
EE
::
Boards
::
Lists
::
CreateService
prepend
EE
::
Boards
::
Lists
::
CreateService
def
execute
(
board
)
def
execute
(
board
)
...
...
app/services/boards/lists/destroy_service.rb
View file @
22439322
module
Boards
module
Boards
module
Lists
module
Lists
class
DestroyService
<
BaseService
class
DestroyService
<
B
oards
::
B
aseService
def
execute
(
list
)
def
execute
(
list
)
return
false
unless
list
.
destroyable?
return
false
unless
list
.
destroyable?
...
...
app/services/boards/lists/generate_service.rb
View file @
22439322
module
Boards
module
Boards
module
Lists
module
Lists
class
GenerateService
<
BaseService
class
GenerateService
<
B
oards
::
B
aseService
def
execute
(
board
)
def
execute
(
board
)
return
false
unless
board
.
lists
.
movable
.
empty?
return
false
unless
board
.
lists
.
movable
.
empty?
...
...
app/services/boards/lists/list_service.rb
View file @
22439322
module
Boards
module
Boards
module
Lists
module
Lists
class
ListService
<
BaseService
class
ListService
<
B
oards
::
B
aseService
def
execute
(
board
)
def
execute
(
board
)
board
.
lists
.
create
(
list_type: :backlog
)
unless
board
.
lists
.
backlog
.
exists?
board
.
lists
.
create
(
list_type: :backlog
)
unless
board
.
lists
.
backlog
.
exists?
...
...
app/services/boards/lists/move_service.rb
View file @
22439322
module
Boards
module
Boards
module
Lists
module
Lists
class
MoveService
<
BaseService
class
MoveService
<
B
oards
::
B
aseService
def
execute
(
list
)
def
execute
(
list
)
@board
=
list
.
board
@board
=
list
.
board
@old_position
=
list
.
position
@old_position
=
list
.
position
...
...
spec/ee/spec/services/boards/issues/move_service_spec.rb
View file @
22439322
...
@@ -99,7 +99,7 @@ describe Boards::Issues::MoveService, services: true do
...
@@ -99,7 +99,7 @@ describe Boards::Issues::MoveService, services: true do
issue
.
move_to_end
&&
issue
.
save!
issue
.
move_to_end
&&
issue
.
save!
end
end
params
.
merge!
(
move_after_i
id:
issue1
.
iid
,
move_before_iid:
issue2
.
i
id
)
params
.
merge!
(
move_after_i
d:
issue1
.
id
,
move_before_id:
issue2
.
id
)
described_class
.
new
(
group
,
user
,
params
).
execute
(
issue
)
described_class
.
new
(
group
,
user
,
params
).
execute
(
issue
)
...
...
spec/services/issues/update_service_spec.rb
View file @
22439322
...
@@ -80,7 +80,7 @@ describe Issues::UpdateService, :mailer do
...
@@ -80,7 +80,7 @@ describe Issues::UpdateService, :mailer do
issue
.
save
issue
.
save
end
end
opts
[
:move_between_i
ids
]
=
[
issue1
.
iid
,
issue2
.
i
id
]
opts
[
:move_between_i
ds
]
=
[
issue1
.
id
,
issue2
.
id
]
update_issue
(
opts
)
update_issue
(
opts
)
...
...
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