Sha256: f802d5191774745a324c7fa35e5be5c7fdaa18d6620798e67f373c2a913d17d5
Contents?: true
Size: 677 Bytes
Versions: 40
Compression:
Stored size: 677 Bytes
Contents
# This overrides the before method provided by resource_controller so that the current_user is authorized # for each action before proceding. module ResourceController module Helpers module Internal protected # Calls the before block for the action, if one is present. def before(action) resource = case action when :index, :new, :create model else object end if resource.respond_to? :token authorize! action, resource, session[:access_token] else authorize! action, resource end invoke_callbacks *self.class.send(action).before end end end end
Version data entries
40 entries across 40 versions & 7 rubygems