Implement role authorization

This commit is contained in:
Stella Rouzi 2014-08-12 11:51:59 +03:00
parent 6755328c4c
commit e2fb434dc7
122 changed files with 1386 additions and 751 deletions

View file

@ -10,17 +10,20 @@
%span.glyphicon.glyphicon-home
All Conferences
- @conferences.each do |conference|
- if can? :show, conference
%li
= link_to(admin_conference_path(conference.short_title)) do
%span.glyphicon.glyphicon-cog
Manage
= conference.short_title
- if (current_user.is_admin) || (current_user.has_role? :organizer, :any)
%li
= link_to(admin_conference_path(conference.short_title)) do
%span.glyphicon.glyphicon-cog
Manage
= conference.short_title
%li
= link_to(new_admin_conference_path) do
%span.glyphicon.glyphicon-plus
New Conference
%hr
%li
= link_to(admin_users_path) do
%span.glyphicon.glyphicon-user
Users
= link_to(new_admin_conference_path) do
%span.glyphicon.glyphicon-plus
New Conference
- if can? :index, User
%hr
%li
= link_to(admin_users_path) do
%span.glyphicon.glyphicon-user
Users