diff options
| author | Vlatka Pavisic | 2017-02-06 11:42:12 +0100 | 
|---|---|---|
| committer | Vlatka Pavisic | 2017-02-07 11:25:29 +0100 | 
| commit | d94b1271d147fdb5bbd1e616e116173198e858db (patch) | |
| tree | e1b5631e72e009ffd80fdf4e47159b2b11cd899e /app/controllers/connection_links_controller.rb | |
| parent | 9c3095c20aaef122212ed71ce8818e3a18b13308 (diff) | |
| download | chouette-core-d94b1271d147fdb5bbd1e616e116173198e858db.tar.bz2 | |
Refs #2476 : Disable modification and deletion of resources from another referential; in progress
Diffstat (limited to 'app/controllers/connection_links_controller.rb')
| -rw-r--r-- | app/controllers/connection_links_controller.rb | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/app/controllers/connection_links_controller.rb b/app/controllers/connection_links_controller.rb index ca36a999f..abeb9dd6a 100644 --- a/app/controllers/connection_links_controller.rb +++ b/app/controllers/connection_links_controller.rb @@ -10,7 +10,9 @@ class ConnectionLinksController < ChouetteController    respond_to :kml, :only => :show    respond_to :js, :only => :index -  def index     +  include PolicyChecker + +  def index      index! do |format|        format.html {          if collection.out_of_bounds? @@ -18,7 +20,7 @@ class ConnectionLinksController < ChouetteController          end          build_breadcrumb :index        } -    end        +    end    end    def show @@ -36,10 +38,10 @@ class ConnectionLinksController < ChouetteController    end    protected -   +    alias_method :connection_link, :resource -  def collection     +  def collection      @q = referential.connection_links.search(params[:q])      @connection_links ||= @q.result(:distinct => true).order(:name).paginate(:page => params[:page])    end @@ -53,7 +55,7 @@ class ConnectionLinksController < ChouetteController    end    private -   +    def connection_link_params      params.require(:connection_link).permit( :connection_link_type,:departure_id, :arrival_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs )    end | 
