diff options
| author | Hiral Bhavsar <hbh@odoo.com> | 2020-01-02 07:22:46 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2020-03-20 10:09:10 +0000 |
| commit | 73834a659c72639b1c3e2a18bfd431b35089ef1e (patch) | |
| tree | 812e0840fdeb1b01665ce4458d369e0f2137a1cc /addons/web/static/src/js/views | |
| parent | 3e9293e0e8bfa6561288b03980e7fe34206a3087 (diff) | |
[IMP] calendar, web: private events shouldn't be editable/deletable
Before this commit, when user attempts to edit or delete a private
event without being an attendee, it raises an access right error.
This commit disables edit and delete buttons in this case, in
addition to hide event details.
task-2151150
Closes https://github.com/odoo/odoo/pull/42569
closes odoo/odoo#42569
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views')
| -rw-r--r-- | addons/web/static/src/js/views/calendar/calendar_popover.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/calendar/calendar_popover.js b/addons/web/static/src/js/views/calendar/calendar_popover.js index 1094f345c7d..8a5e5a7ecae 100644 --- a/addons/web/static/src/js/views/calendar/calendar_popover.js +++ b/addons/web/static/src/js/views/calendar/calendar_popover.js @@ -27,7 +27,7 @@ var CalendarPopover = Widget.extend(StandaloneFieldManagerMixin, { this.fields = eventInfo.fields; this.event = eventInfo.event; this.modelName = eventInfo.modelName; - this.canDelete = eventInfo.canDelete; + this._canDelete = eventInfo.canDelete; }, /** * @override @@ -47,6 +47,29 @@ var CalendarPopover = Widget.extend(StandaloneFieldManagerMixin, { }, //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * @return {boolean} + */ + isEventDeletable() { + return this._canDelete;; + }, + /** + * @return {boolean} + */ + isEventDetailsVisible() { + return true; + }, + /** + * @return {boolean} + */ + isEventEditable() { + return true; + }, + + //-------------------------------------------------------------------------- // Private //-------------------------------------------------------------------------- |
