app/controllers/application_controller.rb
# Following 3 methods moved here to ensure they are loaded at the right time and will be available to all controllers
Following 3 methods moved here to ensure they are loaded at the right time and will be available to all controllers
Following 3 methods moved here to ensure they are loaded at the right time and will be available to all controllers
def find_by_id_filtered(db, id)
    raise _("Invalid input") unless is_integer?(id)
    unless db.where(:id => from_cid(id)).exists?
      msg = _("Selected %{model_name} no longer exists") % {:model_name => ui_lookup(:model => db.to_s)}
      raise msg
    end
    Rbac.filtered(db, :conditions => ["#{db.table_name}.id = ?", id], :user => current_user).first ||
      raise(_("User '%{user_id}' is not authorized to access '%{model}' record id '%{record_id}'") %
              {:user_id   => current_userid,
               :record_id => id,
               :model     => ui_lookup(:model => db.to_s)})
  end
def find_by_id_filtered ( db , id ) raise _ ( "Invalid input" ) unless is_integer? ( id ) unless db . where ( :id => from_cid ( id ) ) . exists? msg = _ ( "Selected %{model_name} no longer exists" ) % { :model_name => ui_lookup ( :model => db . to_s ) } raise msg end Rbac . filtered ( db , :conditions => [ "#{db.table_name}.id = ?" , id ] , :user => current_user ) . first || raise ( _ ( "User '%{user_id}' is not authorized to access '%{model}' record id '%{record_id}'" ) % { :user_id => current_userid , :record_id => id , :model => ui_lookup ( :model => db . to_s ) } ) end
Following 3 methods moved here to ensure they are loaded at the right time and will be available to all controllers
Following 3 methods moved here to ensure they are loaded at the right time and will be available to all controllers
db
<not_specific>
id
<not_specific>