Skip to content
Snippets Groups Projects
Commit 0cd54df5 authored by std-odoo's avatar std-odoo
Browse files

[FIX] event: allow internal users to read registrations


Bug
===
Since 85053a8b we limited the access
of the registration to the event users. But now we want to limit the
access to the internal users.

So only the portal users and the public users will be concerned by this
restriction.

Task-2666823

closes odoo/odoo#78235

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent d7563d25
No related branches found
No related tags found
No related merge requests found
......@@ -1711,6 +1711,12 @@ msgstr ""
msgid "Only event users or managers are allowed to create or update registrations."
msgstr "Only event users or managers are allowed to create or update registrations."
#. module: event
#: code:addons/event/models/event.py:441
#, python-format
msgid "Only internal users are allowed to read registrations."
msgstr "Only internal users are allowed to read registrations."
#. module: event
#: model_terms:event.event,description:event.event_0
msgid ""
......
......@@ -436,7 +436,11 @@ class EventRegistration(models.Model):
@api.model
def check_access_rights(self, operation, raise_exception=True):
if not self.env.is_admin() and not self.user_has_groups('event.group_event_user'):
if operation == 'read' and not self.env.is_admin() and not self.user_has_groups('base.group_user'):
if raise_exception:
raise AccessError(_('Only internal users are allowed to read registrations.'))
return False
elif operation != 'read' and not self.env.is_admin() and not self.user_has_groups('event.group_event_user'):
if raise_exception:
raise AccessError(_('Only event users or managers are allowed to create or update registrations.'))
return False
......
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