简体   繁体   English

Odoo15 安全,我可以看到不可见的字段或组

[英]Odoo15 Security, I can see invisible fields or groups

I have a question about the Odoo Security.我有一个关于 Odoo 安全的问题。

Ass you can see, there is no button in the picture below.屁股你可以看到,下图中没有按钮。 Because the button is invisible depends on the attrs.因为按钮不可见取决于属性。

For example this code:例如这段代码:

attrs="{'invisible': [('purchase_approve_admin', ',=', 'neutral')]}"

在此处输入图像描述

But i can change this state from source code.但是我可以从源代码中更改这个 state。

Like this:像这样:

I can control odoo forms' attrs from here.我可以从这里控制 odoo 表单的属性。

在此处输入图像描述

在此处输入图像描述

So the buttons is visible.所以按钮是可见的。

Final:最终的:

在此处输入图像描述

Question is, How can i prevent this problem?问题是,我怎样才能防止这个问题?

Make a separate group like " group_approve_ceo " and assign it to your field, button, or menu.创建一个单独的组,如“ group_approve_ceo ”,并将其分配给您的字段、按钮或菜单。 Only assign this group to the CEO or user who should have access仅将此组分配给应有权访问的 CEO 或用户

<button name="compute_purchase_approve_ceo"   type="object" class="btn btn-primary" groups="model_name.group_approve_ceo"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM