diff options
| author | Sébastien Theys <seb@odoo.com> | 2018-07-20 12:02:16 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2018-12-12 12:44:03 +0000 |
| commit | b9c8ba83e6b367275eca28255dd7df9b8ac84aa1 (patch) | |
| tree | 388eb2d542849b73e1980b0483cf5ca426576192 /addons/mail/static/tests/activity_tests.js | |
| parent | 13eb9b9c5b77cb42616f91dc4db48e0a6aab014e (diff) | |
[IMP] mail: clean activities access rights
This commit improves code of access rights checks when creating or updating
activities. Several points triggers this commit
* we would like to use _filter_access_rules and override it on activities
model in order to be more standard;
* we would like to get rid of sudo used in various CRUD overrides as using
standard ORM method allows to correctly use current user;
* we would like to get rid of create_user_id field once we can keep the
current user as create_uid;
Access rights are a bit updated. They are now the following
* you can create activities for documents like posting messages (using
_mail_post_access attribute; if not defined, write access on document
is required);
* you can read activities for documents you can read;
* you can write and unlink activities either following the defined access
rule (created OR assigned), and otherwise like posting messages (
using _mail_post_access attribute; if not defined, write access on
document is required);
In this commit we also hide edit / mark as done / cancel buttons for
activities the current user cannot modify.
This commit is linked to task ID 1856417 and PR #27619.
Co-Authored-By: Sébastien Theys <seb@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Diffstat (limited to 'addons/mail/static/tests/activity_tests.js')
| -rw-r--r-- | addons/mail/static/tests/activity_tests.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/mail/static/tests/activity_tests.js b/addons/mail/static/tests/activity_tests.js index 85188a59f15..78e2bf9bba1 100644 --- a/addons/mail/static/tests/activity_tests.js +++ b/addons/mail/static/tests/activity_tests.js @@ -99,6 +99,7 @@ QUnit.module('activity view', { activity_type_id: { string: "Activity type", type: "many2one", relation: "mail.activity.type" }, display_name: { string: "Display name", type: "char" }, date_deadline: { string: "Due Date", type: "date" }, + can_write: { string: "Can write", type: "boolean" }, state: { string: 'State', type: 'selection', @@ -112,6 +113,8 @@ QUnit.module('activity view', { id: 1, display_name: "An activity", date_deadline: moment().add(3, "days").format("YYYY-MM-DD"), // now + can_write: true, + state: "planned", activity_type_id: 1, mail_template_ids: [8, 9], @@ -120,6 +123,7 @@ QUnit.module('activity view', { id: 2, display_name: "An activity", date_deadline: moment().format("YYYY-MM-DD"), // now + can_write: true, state: "today", activity_type_id: 1, mail_template_ids: [8, 9], @@ -128,6 +132,7 @@ QUnit.module('activity view', { id: 3, display_name: "An activity", date_deadline: moment().subtract(2, "days").format("YYYY-MM-DD"), // now + can_write: true, state: "overdue", activity_type_id: 2, mail_template_ids: [], |
