aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/referentials_controller.rb
diff options
context:
space:
mode:
authorXinhui2016-11-22 17:21:38 +0100
committerXinhui2016-11-22 17:21:56 +0100
commitf12aad6a79ba71d59f30c1ae977babfa8d0d248f (patch)
tree0d4df3a507f5feb87cf6bda090e87af4c6db0a94 /app/controllers/referentials_controller.rb
parent1a081d15a16f3bae8b2be35adf69ff4773265765 (diff)
downloadchouette-core-f12aad6a79ba71d59f30c1ae977babfa8d0d248f.tar.bz2
ReferentialPolicy
Refs #1998
Diffstat (limited to 'app/controllers/referentials_controller.rb')
-rw-r--r--app/controllers/referentials_controller.rb6
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,