Help Req Openerp Access control list and Grid, role managment etc

Asked by Hammad

I m a biginer and working in OPenErp from Last one month, i desperatly need some help req access control list and Grid, Role Management etc, bec i dont know how to work on it,
i checked www.docs.openerp.com , but have't found much help on that.
Videos and other information will really help me alot but i have't found these kind of resources regarding Openerp Security.

I will appreciate for your help and recommendations.

Best Regards

Question information

Language:
English Edit question
Status:
Answered
For:
OpenERP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Deven Moga (erpsupport) said :
#1

Hello Hammad,

Can you please tell me in brief which information you want about Security?

Sincerely,
Deven

Revision history for this message
Nicolas DS (zyphos) said :
#2

Have a look in account 5.0 module: The security is made by 3 files.
account/__terp__.py (that tells in which file are security rules):
@line 40
'update_xml': [
        'security/account_security.xml',
        'security/ir.model.access.csv',

security/account_security.xml (That create group of user, and set access to menu to only those group):
<?xml version="1.0" encoding="utf-8"?><openerp><data noupdate="0">
    <record id="group_account_invoice" model="res.groups">
        <field name="name">Finance / Invoice</field>
    </record>
    <record id="group_account_user" model="res.groups">
        <field name="name">Finance / Accountant</field>
    </record>
    <record id="group_account_manager" model="res.groups">
        <field name="name">Finance / Manager</field>
    </record>
 <record id="menu_finance_configuration" model="ir.ui.menu">
  <field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
 </record>

security/ir.model.access.csv: (contains security rules for model access, model are OpenErp 'object'):
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_account_payment_term","account.payment.term","model_account_payment_term","account.group_account_user",1,0,0,0
"access_account_payment_term_line","account.payment.term.line","model_account_payment_term_line","account.group_account_user",1,0,0,0
"access_account_account_type","account.account.type","model_account_account_type","account.group_account_user",1,0,0,0

For the 'id' field you can choose what you want, but be as understandable as you can. Notice in the ir.model.access.csv file that the xml_id have a the module name as prefix. "account."

Be also carreful about the meaning of 'module' and 'model'.
module = an OpenErp Add-ons package.
model = an OpenErp object.

Can you help with this problem?

Provide an answer of your own, or ask Hammad for more information if necessary.

To post a message you must log in.