diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-02-25 14:43:19 +0300 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-02-25 14:43:19 +0300 |
commit | ddfdd494f01571604201b9da911d7c169376e77f (patch) | |
tree | 586138ea2b1c4889ce43528820de1b87788e98cd /app/controllers | |
parent | c6b9ac860c654ec305c779ac1843e1d2ad096c31 (diff) |
Allow maintainers to remove pages
Move remove_pages permission to maintainer
Fix before_action in pages controller to check `remove_pages`
permission
Add specs
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/pages_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/projects/pages_controller.rb b/app/controllers/projects/pages_controller.rb index d0e35bee986..73e629ab7c3 100644 --- a/app/controllers/projects/pages_controller.rb +++ b/app/controllers/projects/pages_controller.rb @@ -5,7 +5,8 @@ class Projects::PagesController < Projects::ApplicationController before_action :require_pages_enabled! before_action :authorize_read_pages!, only: [:show] - before_action :authorize_update_pages!, except: [:show] + before_action :authorize_update_pages!, except: [:show, :destroy] + before_action :authorize_remove_pages!, only: [:destroy] # rubocop: disable CodeReuse/ActiveRecord def show |