[REF-FIX] website_slides : review and fix access, vote, comment and rating
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
Showing
- addons/website_slides/controllers/main.py 9 additions, 8 deletionsaddons/website_slides/controllers/main.py
- addons/website_slides/models/slide_channel.py 14 additions, 7 deletionsaddons/website_slides/models/slide_channel.py
- addons/website_slides/models/slide_slide.py 5 additions, 38 deletionsaddons/website_slides/models/slide_slide.py
- addons/website_slides/static/src/js/slides_slide_like.js 5 additions, 3 deletionsaddons/website_slides/static/src/js/slides_slide_like.js
- addons/website_slides/views/website_slides_templates_course.xml 10 additions, 14 deletions.../website_slides/views/website_slides_templates_course.xml
- addons/website_slides/views/website_slides_templates_lesson.xml 3 additions, 3 deletions.../website_slides/views/website_slides_templates_lesson.xml
Loading
Please register or sign in to comment