[FIX] website_slides: Raise error if not responsible on invite
Steps to reproduce:
- Install `E-learning` module
- Create a user X with only "Officer" as rights for `E-learning`
- Login with user X
- Go to `E-learning` and open any course
- Ensure that the user X is not the responsible and that the course
enroll policy is set to "On invitation"
- Invite any user not already a member
Issue:
No user was invited (not added as member) and no warning message
raised.
Cause:
Due to the ir.rule "Channel: officer: create/write own only", the
`Officer` user can only edit (and therefore invite members) on
courses where he is responsible.
Solution:
Add a context key to the 'Invite' buttons in the `Form` and `Kanban`
views of `slide.channel` model so that we can raise an error only in
these flows if the user does not have the rights to invite members.
opw-3133733
closes odoo/odoo#111642
Signed-off-by:
Warnon Aurélien (awa) <awa@odoo.com>
Loading