Browse Source

marketing_security_group addon

pull/128/head
Antonio Espinosa 9 years ago
committed by cubells
parent
commit
73f1b39b70
  1. 62
      marketing_security_group/README.rst
  2. 5
      marketing_security_group/__init__.py
  3. 22
      marketing_security_group/__openerp__.py
  4. 2
      marketing_security_group/security/ir.model.access.csv
  5. 28
      marketing_security_group/security/mail_mass_mailing_security.xml
  6. BIN
      marketing_security_group/static/description/icon.png
  7. 5
      marketing_security_group/wizards/__init__.py
  8. 11
      marketing_security_group/wizards/test_mailing.py

62
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 <https://github.com/OCA/social/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 <https://github.com/OCA/social/issues/new?body=module:%20marketing_security_group%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Rafael Blasco <rafabn@antiun.com>
* Antonio Espinosa <antonioea@antiun.com>
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.

5
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

22
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,
}

2
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

28
marketing_security_group/security/mail_mass_mailing_security.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="mass_mailing_marketing_user_access" model="ir.rule">
<field name="name">Marketing user - Delete own unsent mass mailings</field>
<field name="model_id" ref="mass_mailing.model_mail_mass_mailing"/>
<field name="domain_force">[('create_uid', '=', user.id), ('state', 'in', ('draft', 'test'))]</field>
<field name="groups" eval="[(4, ref('marketing.group_marketing_user'))]"/>
<field eval="0" name="perm_read"/>
<field eval="0" name="perm_write"/>
<field eval="0" name="perm_create"/>
<field eval="1" name="perm_unlink"/>
</record>
<record id="mass_mailing_marketing_manager_access" model="ir.rule">
<field name="name">Marketing manager - Delete all unsent mass mailings</field>
<field name="model_id" ref="mass_mailing.model_mail_mass_mailing"/>
<field name="domain_force">[('state', 'in', ('draft', 'test'))]</field>
<field name="groups" eval="[(4, ref('marketing.group_marketing_manager'))]"/>
<field eval="0" name="perm_read"/>
<field eval="0" name="perm_write"/>
<field eval="0" name="perm_create"/>
<field eval="1" name="perm_unlink"/>
</record>
</data>
</openerp>

BIN
marketing_security_group/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

5
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

11
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')
Loading…
Cancel
Save