Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Commit

Permalink
added rails admin link to superuser menu and renamed relevant ability
Browse files Browse the repository at this point in the history
  • Loading branch information
orenyk committed Sep 17, 2014
1 parent b3b623f commit d5e9bd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(user)
when 'admin'
can :manage, :all
cannot :appoint, :superuser
cannot :access, :active_admin
cannot :access, :rails_admin
cannot [:destroy,:update], User, :role => 'superuser'
when 'checkout'
can :manage, Reservation
Expand Down
3 changes: 3 additions & 0 deletions app/views/layouts/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
<li><%= link_to "Reports", reports_path %></li>
<li><%= link_to "Settings", edit_app_configs_path %></li>
<li><%= link_to "Logs", log_index_path %></li>
<% if can? :access, :rails_admin %>
<li><%= link_to "Rails Admin", rails_admin_path %></li>
<% end %>
</ul>
</li>
<% end %>
Expand Down

4 comments on commit d5e9bd8

@aaron-effron
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is the difference between rails_admin and active_admin?

@orenyk
Copy link
Contributor Author

@orenyk orenyk commented on d5e9bd8 Sep 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are two different Ruby gems. I believe Rails Admin had better Rails 4 compatibility but I'm not sure. In any event, we switched to Rails Admin for v4.

@aaron-effron
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thank you for the response. Also, as per my question yesterday, are admin and superuser the same thing? If so, is the superuser menu the "admin" tab at the top of the page?

@orenyk
Copy link
Contributor Author

@orenyk orenyk commented on d5e9bd8 Sep 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, admin and superuser are two different roles. Admins can manage everything within the app interface and is designed for managers of the media lending organization, whereas superusers can user Rails Admin to modify the database directly (and potentially have other access), and is intended only for a select number of developers / system administrators. In the context of the commit message, the "superuser menu" means the "Admin" menu when viewed as a superuser. Does that make sense?

Please sign in to comment.