mercredi 15 juillet 2015

Active Admin delete button deletes superadmin user

I am using active admin in my app but its showing very different behaviour.

On its user show page for every user its showing of info for admin_user rather than selected user. On delete button admin is deleting self rather than selected user.

Started DELETE "/admin/users/jeremy" for 127.0.0.1 at 2015-07-15 18:22:40 +0530

my config file is

config.authentication_method = :authenticate_admin_user!

its defined as

def authenticate_admin_user!
    authenticate_user!

    unless current_user.superadmin?
      user_not_authorized
    end
  end

Here jeremy is superadmin.

I see the code and found we dont have admin_users table

Aucun commentaire:

Enregistrer un commentaire