[FIX] mail_group: fix access error when browsing public mailing list

To reproduce:

1. Create a new mail group with privacy "Everyone"
  (menu: Website / Configuration / Mailing Lists / Mailing Lists)

2. As an anonymous user, go to /groups and click on its name

3. A 403 Forbidden error is displayed:
   `You are not allowed to access 'Email Aliases' (mail.alias) records.`

This commit is a followup of odoo/odoo@cd2f330bec where global
mail.alias access rights were revoked, so we have to check if alias
is valid as superuser.

closes odoo/odoo#128915

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Xavier ALT
2023-07-19 10:23:59 +02:00
parent 8692250d2a
commit c789f8ad57
+2 -2
View File
@@ -277,9 +277,9 @@
<template id="group_name">
<h1 class="text-center" t-esc="group.name"/>
<h4 class="text-center text-muted" t-if="group.alias_id and group.alias_id.alias_name and group.alias_id.alias_domain">
<h4 class="text-center text-muted" t-if="group.alias_id and group.alias_id.sudo().alias_name and group.alias_id.sudo().alias_domain">
<i class="fa fa-envelope-o" role="img" aria-label="Alias" title="Alias"/>
<a class="text-break" t-attf-href="mailto:#{group.alias_id.alias_name}@#{group.alias_id.alias_domain}" t-field="group.alias_id"/>
<a class="text-break" t-attf-href="mailto:#{group.alias_id.sudo().display_name}" t-field="group.alias_id"/>
</h4>
</template>