aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorVlatka Pavisic2017-01-16 15:21:11 +0100
committerVlatka Pavisic2017-01-16 15:21:11 +0100
commit307f808e2c812bccccd1c6246ca6b8583be4ef40 (patch)
tree694dc741ecef8f502097f5c79e5217f933bd727b /app/controllers
parent9e69db1f517d15ab52cd169e3a5774d9071c3630 (diff)
downloadchouette-core-307f808e2c812bccccd1c6246ca6b8583be4ef40.tar.bz2
Refs #2399 : User routes permissions
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/routes_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb
index 89d2ddef4..be6329006 100644
--- a/app/controllers/routes_controller.rb
+++ b/app/controllers/routes_controller.rb
@@ -10,10 +10,11 @@ class RoutesController < ChouetteController
end
before_action :define_candidate_opposite_routes, only: [:new, :edit, :create, :update]
+ before_action :check_policy, only: [:edit, :update, :destroy]
def index
index! do |format|
- format.html { redirect_to referential_line_path(@referential,@line) }
+ format.html { redirect_to referential_line_path(@referential, @line) }
end
end
@@ -85,6 +86,10 @@ class RoutesController < ChouetteController
end
end
+ def check_policy
+ authorize resource
+ end
+
private
def route_params