diff options
| author | Vlatka Pavisic | 2017-01-16 15:21:11 +0100 |
|---|---|---|
| committer | Vlatka Pavisic | 2017-01-16 15:21:11 +0100 |
| commit | 307f808e2c812bccccd1c6246ca6b8583be4ef40 (patch) | |
| tree | 694dc741ecef8f502097f5c79e5217f933bd727b /app/controllers | |
| parent | 9e69db1f517d15ab52cd169e3a5774d9071c3630 (diff) | |
| download | chouette-core-307f808e2c812bccccd1c6246ca6b8583be4ef40.tar.bz2 | |
Refs #2399 : User routes permissions
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/routes_controller.rb | 7 |
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 |
