diff --git a/marketing_security_group/README.rst b/marketing_security_group/README.rst new file mode 100644 index 00000000..1c815e51 --- /dev/null +++ b/marketing_security_group/README.rst @@ -0,0 +1,62 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================== +Marketing extra security rules +============================== + +This module add a these security features: + +* ACL for allowing marketing user group to remove mass.mailing objects +* Security rule to allow marketing user to delete only his unsent mail.mass_mailing objects +* Security rule to allow marketing manager to delete all unsent mail.mass_mailing objects + +For sent mail.mass_mailing objects, only an user in Administration / Settings group +could remove them, like Odoo standard defines + + +Usage +===== + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/205/8.0 + +For further information, please visit: + +* https://www.odoo.com/forum/help-1 + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + + +Credits +======= + +Contributors +------------ + +* Rafael Blasco +* Antonio Espinosa + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/marketing_security_group/__init__.py b/marketing_security_group/__init__.py new file mode 100644 index 00000000..32f0b5c2 --- /dev/null +++ b/marketing_security_group/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa +# See README.rst file on addon root folder for more details + +from . import wizards diff --git a/marketing_security_group/__openerp__.py b/marketing_security_group/__openerp__.py new file mode 100644 index 00000000..7921c7b6 --- /dev/null +++ b/marketing_security_group/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa +# See README.rst file on addon root folder for more details + +{ + 'name': "Marketing extra security rules", + 'category': 'Marketing', + 'version': '8.0.1.0.0', + 'depends': [ + 'mass_mailing', + ], + 'external_dependencies': {}, + 'data': [ + 'security/ir.model.access.csv', + 'security/mail_mass_mailing_security.xml', + ], + 'author': 'Antiun IngenierĂ­a S.L., ' + 'Odoo Community Association (OCA)', + 'website': 'http://www.antiun.com', + 'license': 'AGPL-3', + 'installable': True, +} diff --git a/marketing_security_group/security/ir.model.access.csv b/marketing_security_group/security/ir.model.access.csv new file mode 100644 index 00000000..50ee10e6 --- /dev/null +++ b/marketing_security_group/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_mass_mailing_user,mail.mass_mailing.user,mass_mailing.model_mail_mass_mailing,marketing.group_marketing_user,1,1,1,1 diff --git a/marketing_security_group/security/mail_mass_mailing_security.xml b/marketing_security_group/security/mail_mass_mailing_security.xml new file mode 100644 index 00000000..ba488193 --- /dev/null +++ b/marketing_security_group/security/mail_mass_mailing_security.xml @@ -0,0 +1,28 @@ + + + + + + Marketing user - Delete own unsent mass mailings + + [('create_uid', '=', user.id), ('state', 'in', ('draft', 'test'))] + + + + + + + + + Marketing manager - Delete all unsent mass mailings + + [('state', 'in', ('draft', 'test'))] + + + + + + + + + diff --git a/marketing_security_group/static/description/icon.png b/marketing_security_group/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/marketing_security_group/static/description/icon.png differ diff --git a/marketing_security_group/wizards/__init__.py b/marketing_security_group/wizards/__init__.py new file mode 100644 index 00000000..d1793cf2 --- /dev/null +++ b/marketing_security_group/wizards/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa +# See README.rst file on addon root folder for more details + +from . import test_mailing diff --git a/marketing_security_group/wizards/test_mailing.py b/marketing_security_group/wizards/test_mailing.py new file mode 100644 index 00000000..ecf7a49d --- /dev/null +++ b/marketing_security_group/wizards/test_mailing.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa +# See README.rst file on addon root folder for more details + +from openerp import models, fields + + +class MailMassMailingTest(models.TransientModel): + _inherit = 'mail.mass_mailing.test' + + mass_mailing_id = fields.Many2one(ondelete='cascade')