Help

OpenERP ver 7 - explaination for Security.xml

Closed
Avatar
priyankahdp

The question has been closed

by
Sudhir Arya (ERP Harbor Consulting Services)
on 04/18/2013 04:57:39
<?xml version="1.0" ?>
<openerp>
    <data>
        <record model="ir.module.category" id="module_lunch_category">
            <field name="name">Lunch</field>
            <field name="description">Helps you handle your lunch needs, if you are a manager you will be able to create new products, cashmoves and to confirm or cancel orders.</field>
            <field name="sequence">16</field>
        </record>
        <record id="group_lunch_user" model="res.groups">
            <field name="name">User</field>
            <field name="category_id" ref="module_lunch_category"/>
        </record>
        <record id="group_lunch_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="implied_ids" eval="[(4, ref('group_lunch_user'))]"/>
            <field name="category_id" ref="module_lunch_category"/>
            <field name="users" eval="[(4, ref('base.user_root'))]"/>
        </record>
    </data>
</openerp>

I'm now stuck with security handling to my application.its code shows here

I refer documentation also for clarify the above xml code. but i'm not get good explanation for version 7 in documentation.i need to clarify below sections. please advice me to get clear idea about it

Please explain

ir.module.category means.?

<record model="ir.module.category" id="module_lunch_category">

model="res.groups" means.?

<record id="group_lunch_user" model="res.groups">

need to clarify whole below line

<field name="implied_ids" eval="[(4, ref('group_lunch_user'))]"/>
Avatar
Discard
1 Answer
9

ir.module.category is an object same as other objects in OpenERP like sal.order, purchase.order, etc. It defines category of application like Sale, Purchase, Warehouse, etc.

<record model="ir.module.category" id="module_lunch_category"> record creates a category for security group.

For example you have seen Sale, Account, Point of Sale groups inside res.users form view in Access Rights tab.


<record id="group_lunch_user" model="res.groups"> creates a group like User, Account Manager, etc.


<field name="implied_ids" eval="[(4, ref('group_lunch_user'))]"/> This means Users of this group automatically inherit those groups. It is same as inheritance.

Here, Manager group inherit security rights and roles of User group also.

You can refer point_of_sale, account or sale or purchase modules security code also.

4 Comments
Avatar
Discard
Avatar
priyankahdp
-

thanks Arya.......thanks a lot :-)

Avatar
mike
-

How do you know this stuff? In the docs under Module Structure/XML Files mention of security.xml is curiously missing and the chapter on security says very little if anything useful at all.

Self learning and R&D. Yes, you are right there is nothing in documents about such things.

Avatar
wilson zauma
-

but for to complement the aswers you need to read this, because this relation with security http://help.openerp.com/question/18704/hide-menu-for-existing-group/