Skip to content
Snippets Groups Projects
user avatar
David Beguin authored
Commit 5798ca28 was assuming the vote and
comment access on slide was related to is_preview mode and was, consequently,
depending on each slide separately.

In fact, it's not because a slide is in preview mode that the user has the right
to vote for this slide. He must be course member to interact with this preview
slide, even if he has the right to read it.

So the vote and comment right are now computed at the level of the course,
and apply to all the slides of this course.

This commit also reviews and apply fixes on review - rating access.

Here are the applied rules regarding vote, comment and rating on course and slides:

A user can review a course:
- If allow_comment is activated on the course AND
- If the user is publisher OR
- If the user has enough karma AND is member of the course.

Note : if the rating is not allowed on the course, not only the button
to review must be hidden but also the entire rating composer.

A user can vote and comment a slide:
- If allow_comment is activated on the course AND
- If the user is publisher OR
- If the user has enough karma AND is member of the course.

Other fix applied is this commit :
- Avoid crash when no promoted slide : When going on course homepage
(documentation type), if no promoted slide, we got a internal server error.

Task ID: 1941250
Partial revert of commit 5798ca28
PR #31567
12fd6a01
History
Name Last commit Last update
..
account
account_analytic_default
account_analytic_default_hr_expense
account_bank_statement_import
account_cancel
account_check_printing
account_facturx
account_lock
account_payment
account_tax_python
account_test
account_voucher
analytic
association
attachment_indexation
auth_ldap
auth_oauth
auth_password_policy
auth_password_policy_signup
auth_signup
barcodes
base_address_city
base_address_extended
base_automation
base_gengo
base_geolocalize
base_iban
base_import
base_import_module
base_setup
base_sparse_field
base_vat
board
bus
calendar
calendar_sms
contacts
crm
crm_iap_lead
crm_iap_lead_website
crm_livechat
crm_phone_validation
decimal_precision
delivery
digest
event
event_sale
fetchmail
fleet
gamification
gamification_sale_crm
google_account
google_calendar
google_drive
google_spreadsheet
hr
hr_attendance
hr_attendance_presence
hr_contract
hr_expense
hr_expense_check
hr_fleet
hr_gamification
hr_holidays
hr_maintenance
hr_org_chart
hr_payroll
hr_payroll_account
hr_presence
hr_recruitment
hr_recruitment_survey
hr_skills
hr_timesheet
hr_timesheet_attendance
http_routing
hw_blackbox_be
hw_drivers
hw_escpos
hw_posbox_homepage
hw_posbox_upgrade
hw_proxy
hw_scale
hw_scanner
hw_screen
iap
im_livechat
im_livechat_mail_bot
im_support
l10n_ae
l10n_ar
l10n_at
l10n_au
l10n_be
l10n_be_hr_payroll
l10n_be_hr_payroll_account
l10n_be_hr_payroll_fleet
l10n_be_invoice_bba
l10n_bo
l10n_br
l10n_ca