Files
odoo_source/addons/mrp/security/mrp_security.xml
T
Yannick Tivisse 1ecba213f4 [IMP] Newly created users get all manager access right
Coming from a bug in web_settings_dashboard. Invited user didn't have any rights
when created from the dashboard, which was leading to an error.

This bug leaded to a new discussion. Better to have basic employee having user
rights for all main applications. For bigger entreprises there is an admin that
will carefully remove extra rights, if necessary. The target is small businesses,
it makes sense that every way to create a user gives the same result.

In conclusion, each new user has a full access to the applications by default

How is it implemented ?
We added an inactive default user which original access right to the groups
'base.group_user' and 'base.group_partner_manager' in base. Each
application will extend the default user's access right by adding the maximal
access right for this application.

On user creation, we will use by default the 'group_id' field from the default
user. We will in the same time remove the ugly 'default_groups_ref' key which
was passed sometimes in the context for some fields in some views, and sometimes
nothing.

So, the user can modify the access rights for the default user, but he should be
aware that removing project user access rights for a default user will prevent
a *created on the fly in a task* user will not be able to access the task.
2015-11-20 16:27:32 +01:00

71 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="group_mrp_user" model="res.groups">
<field name="name">User</field>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<field name="category_id" ref="base.module_category_manufacturing"/>
</record>
<record id="group_mrp_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_manufacturing"/>
<field name="implied_ids" eval="[(4, ref('group_mrp_user'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
<record id="base.default_user" model="res.users">
<field name="groups_id" eval="[(4,ref('mrp.group_mrp_manager'))]"/>
</record>
<record id="group_mrp_routings" model="res.groups">
<field name="name">Manage Work Order Operations</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_rounding_efficiency" model="res.groups">
<field name="name">Manage rounding and efficiency of BoM components</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
</data>
<data noupdate="1">
<!-- Multi -->
<record model="ir.rule" id="mrp_production_rule">
<field name="name">mrp_production multi-company</field>
<field name="model_id" search="[('model','=','mrp.production')]" model="ir.model"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
</record>
<record model="ir.rule" id="mrp_workcenter_rule">
<field name="name">mrp_workcenter multi-company</field>
<field name="model_id" search="[('model','=','mrp.workcenter')]" model="ir.model"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
</record>
<record model="ir.rule" id="mrp_bom_rule">
<field name="name">mrp_bom multi-company</field>
<field name="model_id" search="[('model','=','mrp.bom')]" model="ir.model"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
</record>
<record model="ir.rule" id="mrp_routing_rule">
<field name="name">mrp_routing multi-company</field>
<field name="model_id" search="[('model','=','mrp.routing')]" model="ir.model"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
</record>
<record model="ir.rule" id="mrp_routing_workcenter_rule">
<field name="name">mrp_routing_workcenter multi-company</field>
<field name="model_id" search="[('model','=','mrp.routing.workcenter')]" model="ir.model"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
</record>
</data>
</openerp>