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
Jérome Perrin
gitlab-ce
Commits
5fb436aa
Commit
5fb436aa
authored
Jul 20, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a few nitpicks
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
4d69cb9d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
20 deletions
+9
-20
app/models/ability.rb
app/models/ability.rb
+2
-2
doc/workflow/add-user/add-user.md
doc/workflow/add-user/add-user.md
+2
-2
doc/workflow/groups.md
doc/workflow/groups.md
+2
-2
spec/features/groups/members/user_requests_access_spec.rb
spec/features/groups/members/user_requests_access_spec.rb
+1
-10
spec/features/projects/members/user_requests_access_spec.rb
spec/features/projects/members/user_requests_access_spec.rb
+2
-4
No files found.
app/models/ability.rb
View file @
5fb436aa
...
@@ -372,8 +372,8 @@ class Ability
...
@@ -372,8 +372,8 @@ class Ability
]
]
end
end
if
(
group
.
public?
||
(
group
.
internal?
&&
!
user
.
external?
))
&&
group
.
request_access_enabled
if
group
.
public?
||
(
group
.
internal?
&&
!
user
.
external?
)
rules
<<
:request_access
unless
group
.
users
.
in
clude?
(
user
)
rules
<<
:request_access
if
group
.
request_access_enabled
&&
group
.
users
.
ex
clude?
(
user
)
end
end
rules
.
flatten
rules
.
flatten
...
...
doc/workflow/add-user/add-user.md
View file @
5fb436aa
...
@@ -90,8 +90,8 @@ GitLab account using the same e-mail address the invitation was sent to.
...
@@ -90,8 +90,8 @@ GitLab account using the same e-mail address the invitation was sent to.
## Request access to a project
## Request access to a project
As project owner you can enable or disable non members to request access to
As
a
project owner you can enable or disable non members to request access to
your project. Go to
project settings and click on
**allow users to request access**
your project. Go to
the project settings and click on
**Allow users to request access**
.
As a user, you can request to be a member of a project. Go to the project you'd
As a user, you can request to be a member of a project. Go to the project you'd
like to be a member of, and click the
**Request Access**
button on the right
like to be a member of, and click the
**Request Access**
button on the right
...
...
doc/workflow/groups.md
View file @
5fb436aa
...
@@ -53,8 +53,8 @@ If necessary, you can increase the access level of an individual user for a spec
...
@@ -53,8 +53,8 @@ If necessary, you can increase the access level of an individual user for a spec
## Requesting access to a group
## Requesting access to a group
As group owner you can enable or disable non members to request access to
As
a
group owner you can enable or disable non members to request access to
your group. Go to
group settings and click on
**allow users to request access**
your group. Go to
the group settings and click on
**Allow users to request access**
.
As a user, you can request to be a member of a group. Go to the group you'd
As a user, you can request to be a member of a group. Go to the group you'd
like to be a member of, and click the
**Request Access**
button on the right
like to be a member of, and click the
**Request Access**
button on the right
...
...
spec/features/groups/members/user_requests_access_spec.rb
View file @
5fb436aa
...
@@ -9,19 +9,17 @@ feature 'Groups > Members > User requests access', feature: true do
...
@@ -9,19 +9,17 @@ feature 'Groups > Members > User requests access', feature: true do
background
do
background
do
group
.
add_owner
(
owner
)
group
.
add_owner
(
owner
)
login_as
(
user
)
login_as
(
user
)
visit
group_path
(
group
)
end
end
scenario
'request access feature is disabled'
do
scenario
'request access feature is disabled'
do
group
.
update_attributes
(
request_access_enabled:
false
)
group
.
update_attributes
(
request_access_enabled:
false
)
visit
group_path
(
group
)
visit
group_path
(
group
)
visit
group_path
(
group
)
expect
(
page
).
not_to
have_content
'Request Access'
expect
(
page
).
not_to
have_content
'Request Access'
end
end
scenario
'user can request access to a group'
do
scenario
'user can request access to a group'
do
visit
group_path
(
group
)
perform_enqueued_jobs
{
click_link
'Request Access'
}
perform_enqueued_jobs
{
click_link
'Request Access'
}
expect
(
ActionMailer
::
Base
.
deliveries
.
last
.
to
).
to
eq
[
owner
.
notification_email
]
expect
(
ActionMailer
::
Base
.
deliveries
.
last
.
to
).
to
eq
[
owner
.
notification_email
]
...
@@ -35,15 +33,12 @@ feature 'Groups > Members > User requests access', feature: true do
...
@@ -35,15 +33,12 @@ feature 'Groups > Members > User requests access', feature: true do
end
end
scenario
'user does not see private projects'
do
scenario
'user does not see private projects'
do
visit
group_path
(
group
)
perform_enqueued_jobs
{
click_link
'Request Access'
}
perform_enqueued_jobs
{
click_link
'Request Access'
}
expect
(
page
).
not_to
have_content
project
.
name
expect
(
page
).
not_to
have_content
project
.
name
end
end
scenario
'user does not see group in the Dashboard > Groups page'
do
scenario
'user does not see group in the Dashboard > Groups page'
do
visit
group_path
(
group
)
perform_enqueued_jobs
{
click_link
'Request Access'
}
perform_enqueued_jobs
{
click_link
'Request Access'
}
visit
dashboard_groups_path
visit
dashboard_groups_path
...
@@ -52,8 +47,6 @@ feature 'Groups > Members > User requests access', feature: true do
...
@@ -52,8 +47,6 @@ feature 'Groups > Members > User requests access', feature: true do
end
end
scenario
'user is not listed in the group members page'
do
scenario
'user is not listed in the group members page'
do
visit
group_path
(
group
)
click_link
'Request Access'
click_link
'Request Access'
expect
(
group
.
requesters
.
exists?
(
user_id:
user
)).
to
be_truthy
expect
(
group
.
requesters
.
exists?
(
user_id:
user
)).
to
be_truthy
...
@@ -66,8 +59,6 @@ feature 'Groups > Members > User requests access', feature: true do
...
@@ -66,8 +59,6 @@ feature 'Groups > Members > User requests access', feature: true do
end
end
scenario
'user can withdraw its request for access'
do
scenario
'user can withdraw its request for access'
do
visit
group_path
(
group
)
click_link
'Request Access'
click_link
'Request Access'
expect
(
group
.
requesters
.
exists?
(
user_id:
user
)).
to
be_truthy
expect
(
group
.
requesters
.
exists?
(
user_id:
user
)).
to
be_truthy
...
...
spec/features/projects/members/user_requests_access_spec.rb
View file @
5fb436aa
...
@@ -8,17 +8,17 @@ feature 'Projects > Members > User requests access', feature: true do
...
@@ -8,17 +8,17 @@ feature 'Projects > Members > User requests access', feature: true do
background
do
background
do
project
.
team
<<
[
master
,
:master
]
project
.
team
<<
[
master
,
:master
]
login_as
(
user
)
login_as
(
user
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
end
scenario
'request access feature is disabled'
do
scenario
'request access feature is disabled'
do
project
.
update_attributes
(
request_access_enabled:
false
)
project
.
update_attributes
(
request_access_enabled:
false
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
expect
(
page
).
not_to
have_content
'Request Access'
expect
(
page
).
not_to
have_content
'Request Access'
end
end
scenario
'user can request access to a project'
do
scenario
'user can request access to a project'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
perform_enqueued_jobs
{
click_link
'Request Access'
}
perform_enqueued_jobs
{
click_link
'Request Access'
}
expect
(
ActionMailer
::
Base
.
deliveries
.
last
.
to
).
to
eq
[
master
.
notification_email
]
expect
(
ActionMailer
::
Base
.
deliveries
.
last
.
to
).
to
eq
[
master
.
notification_email
]
...
@@ -32,7 +32,6 @@ feature 'Projects > Members > User requests access', feature: true do
...
@@ -32,7 +32,6 @@ feature 'Projects > Members > User requests access', feature: true do
end
end
scenario
'user is not listed in the project members page'
do
scenario
'user is not listed in the project members page'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
click_link
'Request Access'
click_link
'Request Access'
expect
(
project
.
requesters
.
exists?
(
user_id:
user
)).
to
be_truthy
expect
(
project
.
requesters
.
exists?
(
user_id:
user
)).
to
be_truthy
...
@@ -47,7 +46,6 @@ feature 'Projects > Members > User requests access', feature: true do
...
@@ -47,7 +46,6 @@ feature 'Projects > Members > User requests access', feature: true do
end
end
scenario
'user can withdraw its request for access'
do
scenario
'user can withdraw its request for access'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
click_link
'Request Access'
click_link
'Request Access'
expect
(
project
.
requesters
.
exists?
(
user_id:
user
)).
to
be_truthy
expect
(
project
.
requesters
.
exists?
(
user_id:
user
)).
to
be_truthy
...
...
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