gitlab-org--gitlab-foss/app/views/projects/pages/_destroy.haml
Vladimir Shushlin ddfdd494f0 Allow maintainers to remove pages
Move remove_pages permission to maintainer
Fix before_action in pages controller to check `remove_pages`
permission
Add specs
2019-02-25 11:43:19 +00:00

12 lines
530 B
Text

- if @project.pages_deployed?
- if can?(current_user, :remove_pages, @project)
.card.border-danger
.card-header.bg-danger.text-white Remove pages
.errors-holder
.card-body
%p
Removing pages will prevent them from being exposed to the outside world.
.form-actions
= link_to 'Remove pages', project_pages_path(@project), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove"
- else
.nothing-here-block Only project maintainers can remove pages