Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
5685 Lượt xem

By looking at the openerp orm method document i am not able to understand what is use of check_access_rule orm method and when to use it? Can you explain with an example?

Ảnh đại diện
Huỷ bỏ

Hello Shanky, this method is invoked by CRUD methods at the ORM level, I don't think you would get any benefit by directly invoking it. It's purpose has already been explained by Sudhir.

Câu trả lời hay nhất

Hello Shanky,

check_access_rule(...) method is used to check the Record Rules for the object and for current logged in user and according to defined rule user will have access on the object (Read, Write, Create, Delete).

This method skips record rules for Super Admin user (SUPERUSER_ID) (user with ID 1).

Hope this will help you a bit to understand the working of the method.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

This link may help you

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi, thanks for your quick reply but i have already read this document but i couldn;t understand its actual purpose. When and Why to use check_access_rule method?

Using this method you get access for field, object etc. If you want see example then go document module in that module document.py file line number 84 there is example of this method.