diff options
| author | Xinhui | 2016-11-22 17:21:38 +0100 | 
|---|---|---|
| committer | Xinhui | 2016-11-22 17:21:56 +0100 | 
| commit | f12aad6a79ba71d59f30c1ae977babfa8d0d248f (patch) | |
| tree | 0d4df3a507f5feb87cf6bda090e87af4c6db0a94 /app/controllers/referentials_controller.rb | |
| parent | 1a081d15a16f3bae8b2be35adf69ff4773265765 (diff) | |
| download | chouette-core-f12aad6a79ba71d59f30c1ae977babfa8d0d248f.tar.bz2 | |
ReferentialPolicy
Refs #1998
Diffstat (limited to 'app/controllers/referentials_controller.rb')
| -rw-r--r-- | app/controllers/referentials_controller.rb | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index b7e6d8031..e0d107b30 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -1,6 +1,6 @@  class ReferentialsController < BreadcrumbController -    defaults :resource_class => Referential +  before_action :check_policy, :only => [:edit, :update]    respond_to :html    respond_to :json, :only => :show @@ -87,6 +87,10 @@ class ReferentialsController < BreadcrumbController    end    private +  def check_policy +    authorize resource +  end +    def referential_params      params.require(:referential).permit(        :id,  | 
