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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
b2dc9176
Commit
b2dc9176
authored
Jun 17, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group owner cannot request access to a project of their group
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
f011b86b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
9 deletions
+49
-9
app/views/shared/members/_access_request_buttons.html.haml
app/views/shared/members/_access_request_buttons.html.haml
+11
-9
spec/features/projects/members/group_owner_cannot_request_access_to_his_group_project_spec.rb
..._owner_cannot_request_access_to_his_group_project_spec.rb
+17
-0
spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb
.../group_requester_cannot_request_access_to_project_spec.rb
+21
-0
No files found.
app/views/shared/members/_access_request_buttons.html.haml
View file @
b2dc9176
-
member
=
source
.
members
.
find_by
(
user_id:
current_user
.
id
)
-
group_member
=
source
.
group
.
members
.
find_by
(
user_id:
current_user
.
id
)
if
source
.
try
(
:group
)
-
if
member
-
if
member
.
request?
=
link_to
'Withdraw Access Request'
,
polymorphic_path
([
:leave
,
source
,
:members
]),
method: :delete
,
data:
{
confirm:
remove_member_message
(
member
)
},
-
unless
group_member
-
if
member
-
if
member
.
request?
=
link_to
'Withdraw Access Request'
,
polymorphic_path
([
:leave
,
source
,
:members
]),
method: :delete
,
data:
{
confirm:
remove_member_message
(
member
)
},
class:
'btn access-request-button hidden-xs'
-
else
=
link_to
'Request Access'
,
polymorphic_path
([
:request_access
,
source
,
:members
]),
method: :post
,
class:
'btn access-request-button hidden-xs'
-
else
=
link_to
'Request Access'
,
polymorphic_path
([
:request_access
,
source
,
:members
]),
method: :post
,
class:
'btn access-request-button hidden-xs'
spec/features/projects/members/group_owner_cannot_request_access_to_his_group_project_spec.rb
0 → 100644
View file @
b2dc9176
require
'spec_helper'
feature
'Projects > Members > Group owner cannot request access to his group project'
,
feature:
true
do
let
(
:owner
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
background
do
group
.
add_owner
(
owner
)
login_as
(
owner
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
scenario
'owner does not see the request access button'
do
expect
(
page
).
not_to
have_content
'Request Access'
end
end
spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb
0 → 100644
View file @
b2dc9176
require
'spec_helper'
feature
'Projects > Members > Group requester cannot request access to project'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:owner
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
background
do
group
.
add_owner
(
owner
)
login_as
(
user
)
visit
group_path
(
group
)
perform_enqueued_jobs
{
click_link
'Request Access'
}
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
scenario
'group requester does not see the request access / withdraw access request button'
do
expect
(
page
).
not_to
have_content
'Request Access'
expect
(
page
).
not_to
have_content
'Withdraw Access Request'
end
end
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