Skip to content
Snippets Groups Projects
Commit 99585eac authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[FIX] website_slides: avoid computing access fields as sudo

As compute sudo is now the default values let us ensure fields controlling
actions and access are done using the current user, not admin.
parent 428da3d5
No related branches found
No related tags found
No related merge requests found
......@@ -167,9 +167,9 @@ class Channel(models.Model):
karma_review = fields.Integer('Add Review', default=10, help="Karma needed to add a review on the course")
karma_slide_comment = fields.Integer('Add Comment', default=3, help="Karma needed to add a comment on a slide of this course")
karma_slide_vote = fields.Integer('Vote', default=3, help="Karma needed to like/dislike a slide of this course.")
can_review = fields.Boolean('Can Review', compute='_compute_action_rights')
can_comment = fields.Boolean('Can Comment', compute='_compute_action_rights')
can_vote = fields.Boolean('Can Vote', compute='_compute_action_rights')
can_review = fields.Boolean('Can Review', compute='_compute_action_rights', compute_sudo=False)
can_comment = fields.Boolean('Can Comment', compute='_compute_action_rights', compute_sudo=False)
can_vote = fields.Boolean('Can Vote', compute='_compute_action_rights', compute_sudo=False)
@api.depends('slide_ids.is_published')
def _compute_slide_last_update(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment