字段级访问权限和openerp中的安全性7 [英] Field level access rights and Security in openerp 7

查看:232
本文介绍了字段级访问权限和openerp中的安全性7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有3个用户,如下所示:

Suppose I have 3 users which are as follows:

user_employee having access rights Human Resource /Employee group
user_officer having access rights Human Resource /officer group
user_manager having access rights Human Resource /manager group 

对象 hr_employee(hr.employee)

如果我以 user_manager user_officer 我可以创建/编辑我自己的员工记录。如果我以 user_employee 登录,我无法编辑我自己的员工记录。

If I am logged in as user_manager or user_officer I can create/edit my own employee record. If I am logged in as user_employee I cannot edit my own employee record.

资源/员工组,现在我可以编辑与 hr_employee 相关的所有字段,但我想限制人力资源/员工组下的用户对某些字段的编辑访问权限;例如如果 user_employee 已登录,则他无法编辑 department_id related_user coach_id 活动经理

Then I gave write permission to Human Resource/Employee group and now I can edit all fields which are related to hr_employee, but I want to restrict edit access to users which are under Human Resource/Employee group to certain fields; for example if user_employee is logged in then he is not able to edit department_id or related_user, or coach_id, active, manager, etc.

他只能编辑他的姓名,地址,DOB和其他公开信息。

He can edit just his name, address, DOB, and other public information.

我如何解决这个问题与安全文件夹文件 .xml .csv 文件?

How can I solve this issue with security folder files like .xml or .csv files?

推荐答案

.xml .csv 文件提供更广泛的安全设置:创建 code>和 delete

The .xml and .csv files provide security settings on a broader scale: create, read, update, and delete.

如果您想要每个字段设置,周围有xml视图文件。查看设置。

If you want per field settings instead you'll have to play around with the xml view file. Check out the domain settings.

类似:

<field name="DOB" attrs="{'readonly':[('groups_id.category_id.name','=','Human Resource')]}"/>

以上不是限制性的,但希望能给你想法。

The above is not restrictive enough, but hopefully will give you the idea.

这样可能很方便,我不认为这是一个好主意。根据您公司所在地的法律,公司可以对该数据的准确性负责。让员工向HR中的某人提出任何变更的证据可能是一件好事。

As convenient as this might be, I don't think it's a good idea. Depending on the laws of where your company is located, the company can be responsible for the accuracy of that data. Having the employee present evidence of any changes to somebody in HR can be a good thing.

这篇关于字段级访问权限和openerp中的安全性7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆