Show Logged-in User on rails_admin Dashboard

Asked

Viewed 151 times

0

Good afternoon to everyone, I am developing a project in Rails 5 using Devise, cancancan and rails_admin, what happens is the following, I created some types of users, among them I cite users administrators ( have total manager permission in cancancan )and common users who have some restrictions, the issue is that every admin user I create, right after authentication, already on the main Dashboard of rails_admin is correctly shown the authenticated user name, however common users who do not have permission Manage in cancancan , does not appear.

Login com usuário comum

Login com usuário admin

I appreciate any help.ob

1 answer

1

If someone goes through this, I made the following adjustment, I created the line as below, so that the user can manage to be login.

PS. Adjustment was made in Ability (cancancan )

def initialize(user)
  if user
    if user.kind == 'salesman'
      can :manage, User, id: user.id
end

Browser other questions tagged

You are not signed in. Login or sign up in order to post.