diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index c8086a8db76..f25d58c90e6 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -112,6 +112,13 @@ class mail_thread(osv.AbstractModel): res[id]['message_summary'] = "9 %d %s" % (title, res[id].pop('message_unread_count'), _("New")) return res + def check_access_right(self, cr, uid,ids , context=None ): + grp_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'group_no_one') + user_pid = self.pool.get('res.groups').read(cr, uid, grp_id[1], ['users'], context=context)['users'] + if uid in user_pid: + return True + return False + def _get_subscription_data(self, cr, uid, ids, name, args, context=None): """ Computes: - message_subtype_data: data about document subtypes: which are diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index 155cd74ebeb..c615ceb35e5 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -210,14 +210,19 @@ openerp_mail_followers = function(session, mail) { var self = this; this.followers = records || this.followers; this.message_is_follower = this.set_is_follower(this.followers); + this.check_access = false; + // clean and display title var node_user_list = this.$('.oe_follower_list').empty(); this.$('.oe_follower_title').html(this._format_followers(this.followers.length)); // truncate number of displayed followers var truncated = this.followers.slice(0, this.displayed_nb); _(truncated).each(function (record) { - record.avatar_url = mail.ChatterUtils.get_image(self.session, 'res.partner', 'image_small', record.id); - $(session.web.qweb.render('mail.followers.partner', {'record': record, 'widget': self})).appendTo(node_user_list); + self.ds_model.call('check_access_right', [self.session.uid]).then(function(r){ + self.check_access = r; + record.avatar_url = mail.ChatterUtils.get_image(self.session, 'res.partner', 'image_small', record.id); + $(session.web.qweb.render('mail.followers.partner', {'record': record, 'widget': self})).appendTo(node_user_list); + }) }); // FVA note: be sure it is correctly translated if (truncated.length < this.followers.length) { diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml index 6420046477c..bdcfd1e048c 100644 --- a/addons/mail/static/src/xml/mail_followers.xml +++ b/addons/mail/static/src/xml/mail_followers.xml @@ -31,7 +31,8 @@