vendor/plugins/active_scaffold/lib/active_scaffold/finder.rb
# returns a single record (the given id) but only if it's allowed for the specified action.
# accomplishes this by checking model.#{action}_authorized?
# TODO: this should reside on the model, not the controller
returns a single record (the given id) but only if it's allowed for the specified action.
accomplishes this by checking model.#{action}_authorized.
TODO: this should reside on the model, not the controller
returns a single record ( the given id ) but only if it ' s allowed for the specified action . accomplishes this by checking model . # { action } _authorized . TODO : this should reside on the model not the controller
def find_if_allowed(id, action, klass = beginning_of_chain)
      record = klass.find(id)
      raise ActiveScaffold::RecordNotAllowed unless record.authorized_for?(:action => action.to_sym)
      return record
    end
def find_if_allowed ( id , action , klass = beginning_of_chain ) record = klass . find ( id ) raise ActiveScaffold :: RecordNotAllowed unless record . authorized_for? ( :action => action . to_sym ) return record end
returns a single record (the given id) but only if it's allowed for the specified action.
returns a single record ( the given id ) but only if it ' s allowed for the specified action .
id
<not_specific>
action
<not_specific>
klass
<not_specific>
beginning_of_chain
<not_specific>