Merge pull request #942 from nishanthvijayan/fix-roles-authorization

Fix authorization issues with Roles
This commit is contained in:
Stella Rouzi 2016-04-25 17:18:24 +02:00
commit 0a5ba7a204
6 changed files with 77 additions and 51 deletions

View file

@ -3,16 +3,18 @@
- if users.present?
%table.table.table-striped.table-bordered.table-hover.datatable#users
%thead
%th.col-md-1
- if ( can? :toggle_user, @role )
%th.col-md-1
%th ID
%th Name
%th Email
%tbody
- users.each do |user|
%tr
%td.text-right
= hidden_field_tag "role[user_ids][]", nil
= check_box_tag @conference.short_title, @role.id, (@role.user_ids.include? user.id), method: :post, url: "/admin/conference/#{@conference.short_title}/roles/#{@role.name}/toggle_user?user[email]=#{user.email}&user[state]=", class: 'switch-checkbox', data: { size: 'small', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
- if ( can? :toggle_user, @role )
%td.text-right
= hidden_field_tag "role[user_ids][]", nil
= check_box_tag @conference.short_title, @role.id, (@role.user_ids.include? user.id), method: :post, url: "/admin/conference/#{@conference.short_title}/roles/#{@role.name}/toggle_user?user[email]=#{user.email}&user[state]=", class: 'switch-checkbox', data: { size: 'small', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
%td= user.id
%td= user.name
%td= user.email