Implement role authorization
This commit is contained in:
parent
6755328c4c
commit
e2fb434dc7
122 changed files with 1386 additions and 751 deletions
|
|
@ -18,11 +18,11 @@
|
|||
= ','
|
||||
= label_tag dom_id(q), "Answers: #{q.answers.map {|a| a.title}.join(', ')}"
|
||||
|
||||
%td= link_to 'Edit', edit_admin_conference_question_path(@conference.short_title, q),
|
||||
class: 'btn btn-primary',
|
||||
disabled: q.global == true && !has_role?(current_user, 'Admin')
|
||||
- if can? :update, q
|
||||
%td= link_to 'Edit', edit_admin_conference_question_path(@conference.short_title, q),
|
||||
class: 'btn btn-primary', disabled: q.global == true
|
||||
|
||||
%td= link_to 'Delete', admin_conference_question_path(@conference.short_title, q),
|
||||
method: :delete, remote: true, class: 'btn btn-danger',
|
||||
confirm: "Delete question '#{q.title}'?",
|
||||
disabled: q.global == true && !has_role?(current_user, "Admin")
|
||||
- if can? :destroy, q
|
||||
%td= link_to 'Delete', admin_conference_question_path(@conference.short_title, q),
|
||||
method: :delete, remote: true, class: 'btn btn-danger',
|
||||
confirm: "Delete question '#{q.title}'?", disabled: q.global == true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue