Открыть боковую панель
nt_test121
nt_project_9da4a5yt9x4b
Коммиты
5d6af36f
Коммит
5d6af36f
создал
Май 13, 2015
по автору
Douwe Maan
Просмотр файлов
Fix GitAccess.
владелец
501e1215
Изменения
2
Скрыть пробелы
Построчно
Рядом
lib/gitlab/git_access.rb
Просмотр файла @
5d6af36f
...
...
@@ -136,7 +136,7 @@ def change_access_check(change)
end
unless
user
.
can?
(
action
,
project
)
return
status
=
case
action
when
:force_push_code_to_protected_branches
build_status_object
(
false
,
"You are not allowed to force push code to a protected branch on this project."
)
...
...
@@ -148,7 +148,8 @@ def change_access_check(change)
build_status_object
(
false
,
"You are not allowed to change existing tags on this project."
)
else
# :push_code
build_status_object
(
false
,
"You are not allowed to push code to this project."
)
end
end
return
status
end
build_status_object
(
true
)
...
...
spec/lib/gitlab/git_access_spec.rb
Просмотр файла @
5d6af36f
...
...
@@ -115,18 +115,10 @@
let
(
:actor
)
{
key
}
context
'pull code'
do
context
'allowed'
do
before
{
key
.
projects
<<
project
}
subject
{
access
.
download_access_check
}
it
{
expect
(
subject
.
allowed?
).
to
be_truthy
}
end
context
'denied'
do
subject
{
access
.
download_access_check
}
before
{
key
.
projects
<<
project
}
subject
{
access
.
download_access_check
}
it
{
expect
(
subject
.
allowed?
).
to
be_falsey
}
end
it
{
expect
(
subject
.
allowed?
).
to
be_truthy
}
end
end
end
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать