summaryrefslogtreecommitdiff
path: root/addons/website_slides_survey
diff options
context:
space:
mode:
authormcm-odoo <mcm@odoo.com>2019-10-28 09:58:28 +0000
committerThibault Delavallée <tde@odoo.com>2019-12-12 14:12:51 +0000
commit90bf317c013323ed9f6195d61440e2bd0e09ac2c (patch)
tree91c6e68006b333fbfd241659b845740ea4ff598b /addons/website_slides_survey
parenta0fc349f045c5d92683e68c899031d3350f7d642 (diff)
[REF] website_slides: define specific eLearning user groups
PURPOSE Have user groups specific to eLearning to separate them from generic website editors. Indeed this is a specific work area and require more than pure design skills. SPECIFICATIONS Two user groups are added in this commit * group_website_slides_officer + can read any course/slide + can create a course (will be responsible) + can write on its courses + can upload slides to the courses he is responsible + can publish slides to the courses he is responsible - cannot unlink courses/slides (you should archive them) * implies group_website_publisher in order to see the top navbar in frontend with the publish toggle button and the new content button; * group_website_slides_manager: has full rights + can read any course/slide; + can create a course; + can add slide to any courses; + can publish any courses/slides; + can unlink any courses/slides; + has access to reporting menu entries; Rights for other groups are untouched for courses / slides. As a reminder we still support responsibles being outside of eLearning groups, for example if an employee is a teacher that handles a course: * people in upload_group_ids of a channel can upload slides, even if they don't belong to any eLearning group; * people responsible of a course can upload and publish slides even if they don't belong to any eLearning group (done through controller as they don't have real rights on underlying models); We choose to keep the survey rights separated from eLearning ones. Indeed it is easy in odoo to update the imply_ids field of groups if necessary to link survey / eLearning groups; default user template can also be updated easily. Standard Odoo should therefore correctly separate those groups. The only specific rights is that eLearning officers can read all surveys, allowing to choose them for certification-based courses. LINKS Task ID 2062462 PR #39485 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_slides_survey')
-rw-r--r--addons/website_slides_survey/__manifest__.py1
-rw-r--r--addons/website_slides_survey/models/survey_survey.py4
-rw-r--r--addons/website_slides_survey/security/ir.model.access.csv2
3 files changed, 4 insertions, 3 deletions
diff --git a/addons/website_slides_survey/__manifest__.py b/addons/website_slides_survey/__manifest__.py
index 10114ec6f6a..11a35637a44 100644
--- a/addons/website_slides_survey/__manifest__.py
+++ b/addons/website_slides_survey/__manifest__.py
@@ -10,6 +10,7 @@
'installable': True,
'auto_install': True,
'data': [
+ 'security/ir.model.access.csv',
'views/assets.xml',
'views/slide_channel_views.xml',
'views/slide_slide_views.xml',
diff --git a/addons/website_slides_survey/models/survey_survey.py b/addons/website_slides_survey/models/survey_survey.py
index 7f4e0c48bce..6cc5b857069 100644
--- a/addons/website_slides_survey/models/survey_survey.py
+++ b/addons/website_slides_survey/models/survey_survey.py
@@ -8,9 +8,9 @@ class Survey(models.Model):
_inherit = 'survey.survey'
def _check_answer_creation(self, user, partner, email, test_entry=False, check_attempts=True, invite_token=False):
- """ Overridden to allow website_publisher to test certifications. """
+ """ Overridden to allow website_slides_officer to test certifications. """
self.ensure_one()
- if test_entry and user.has_group('website.group_website_publisher'):
+ if test_entry and user.has_group('website_slides.group_website_slides_officer'):
return True
return super(Survey, self)._check_answer_creation(user, partner, email, test_entry=test_entry, check_attempts=check_attempts, invite_token=invite_token)
diff --git a/addons/website_slides_survey/security/ir.model.access.csv b/addons/website_slides_survey/security/ir.model.access.csv
index 15efcd8f67b..fe5839ec795 100644
--- a/addons/website_slides_survey/security/ir.model.access.csv
+++ b/addons/website_slides_survey/security/ir.model.access.csv
@@ -1,2 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_survey_publisher,survey.survey.publisher,model_survey_survey,website.group_website_publisher,1,0,0,0
+access_survey_slides_officer,access.survey.slides.officer,model_survey_survey,website_slides.group_website_slides_officer,1,0,0,0