Only a moderator can delete an organisation

This commit is contained in:
echarp 2015-12-27 12:56:33 +01:00
parent c994947f22
commit 0b3db18477
2 changed files with 8 additions and 6 deletions

View File

@ -2,9 +2,10 @@
class OrgasController < ApplicationController
before_action :set_orga, except: [:index, :new, :create]
before_action :set_mailer_host
before_action :authenticate_user!, only: [:edit, :update, :cancel, :destroy],
before_action :authenticate_user!, only: [:edit, :update],
unless: :check_secret
before_action :authenticate_user!, only: [:validate, :accept]
before_action :authenticate_user!, only: [:validate, :accept, :cancel,
:destroy]
def index
@search = Orga.moderated.includes(:kind).includes(:region).search params[:q]

View File

@ -51,6 +51,7 @@
= link_to edit_orga_path @orga do
%em.fa.fa-lg.fa-pencil
= t '.edit'
- if user_signed_in?
%h2
= link_to cancel_orga_path @orga do
%em.fa.fa-lg.fa-thumbs-down