diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-22 07:54:11 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-22 07:54:11 +0000 |
commit | 8ae026a6e64846d720184dbdee30d274a4e8ca24 (patch) | |
tree | b31b837da1d76129a92a459b9f555eb52f52abc7 | |
parent | 548b7ce80486f98f3685562a46c478116dd4558b (diff) | |
parent | 071ae2619cbe8d39b87518eef65009cbfb3939c9 (diff) | |
download | gitlab-ce-8ae026a6e64846d720184dbdee30d274a4e8ca24.tar.gz |
Merge branch 'fix-ci-permissions' into 'master'
Fix CI permissions
![Screen_Shot_2015-09-21_at_20.23.16](https://gitlab.com/gitlab-org/gitlab-ce/uploads/6f40699507d0dce148d0054a093f0d63/Screen_Shot_2015-09-21_at_20.23.16.png)
This fixes two problems:
- Allow developers to retry builds
- Hide advanced project options from CI page for non-admin users
See merge request !1379
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | app/controllers/ci/application_controller.rb | 2 | ||||
-rw-r--r-- | app/views/layouts/ci/_nav_project.html.haml | 83 |
3 files changed, 45 insertions, 42 deletions
diff --git a/CHANGELOG b/CHANGELOG index ceebdc12d0f..8e516322a6a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -44,6 +44,8 @@ v 8.0.0 (unreleased) - Retrieving oauth token with LDAP credentials - Load Application settings from running database unless env var USE_DB=false - Added Drone CI integration (Kirill Zaitsev) + - Allow developers to retry builds + - Hide advanced project options for non-admin users - Fail builds if no .gitlab-ci.yml is found - Refactored service API and added automatically service docs generator (Kirill Zaitsev) - Added web_url key project hook_attrs (Kirill Zaitsev) diff --git a/app/controllers/ci/application_controller.rb b/app/controllers/ci/application_controller.rb index 8d8ff75ff72..d8227e632e4 100644 --- a/app/controllers/ci/application_controller.rb +++ b/app/controllers/ci/application_controller.rb @@ -38,7 +38,7 @@ module Ci end def authorize_manage_builds! - unless can?(current_user, :admin_project, gl_project) + unless can?(current_user, :manage_builds, gl_project) return page_404 end end diff --git a/app/views/layouts/ci/_nav_project.html.haml b/app/views/layouts/ci/_nav_project.html.haml index b7e997be108..cb1dece073c 100644 --- a/app/views/layouts/ci/_nav_project.html.haml +++ b/app/views/layouts/ci/_nav_project.html.haml @@ -10,44 +10,45 @@ %span Commits %span.count= @project.commits.count - = nav_link path: 'charts#show' do - = link_to ci_project_charts_path(@project) do - = icon('bar-chart fw') - %span - Charts - = nav_link path: ['runners#index', 'runners#show', 'runners#edit'] do - = link_to ci_project_runners_path(@project) do - = icon('cog fw') - %span - Runners - = nav_link path: 'variables#show' do - = link_to ci_project_variables_path(@project) do - = icon('code fw') - %span - Variables - = nav_link path: 'web_hooks#index' do - = link_to ci_project_web_hooks_path(@project) do - = icon('link fw') - %span - Web Hooks - = nav_link path: 'triggers#index' do - = link_to ci_project_triggers_path(@project) do - = icon('retweet fw') - %span - Triggers - = nav_link path: ['services#index', 'services#edit'] do - = link_to ci_project_services_path(@project) do - = icon('share fw') - %span - Services - = nav_link path: 'events#index' do - = link_to ci_project_events_path(@project) do - = icon('book fw') - %span - Events - %li.separate-item - = nav_link path: 'projects#edit' do - = link_to edit_ci_project_path(@project) do - = icon('cogs fw') - %span - Settings + - if can?(current_user, :admin_project, gl_project) + = nav_link path: 'charts#show' do + = link_to ci_project_charts_path(@project) do + = icon('bar-chart fw') + %span + Charts + = nav_link path: ['runners#index', 'runners#show', 'runners#edit'] do + = link_to ci_project_runners_path(@project) do + = icon('cog fw') + %span + Runners + = nav_link path: 'variables#show' do + = link_to ci_project_variables_path(@project) do + = icon('code fw') + %span + Variables + = nav_link path: 'web_hooks#index' do + = link_to ci_project_web_hooks_path(@project) do + = icon('link fw') + %span + Web Hooks + = nav_link path: 'triggers#index' do + = link_to ci_project_triggers_path(@project) do + = icon('retweet fw') + %span + Triggers + = nav_link path: ['services#index', 'services#edit'] do + = link_to ci_project_services_path(@project) do + = icon('share fw') + %span + Services + = nav_link path: 'events#index' do + = link_to ci_project_events_path(@project) do + = icon('book fw') + %span + Events + %li.separate-item + = nav_link path: 'projects#edit' do + = link_to edit_ci_project_path(@project) do + = icon('cogs fw') + %span + Settings |