字段级访问权限和openerp中的安全性7 [英] Field level access rights and Security in 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
,活动
,经理$ c $
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屋!