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

Default odoo project user have only read permission given. But i want to give project edit permission if any user from project user group have project manager of that project.

Currenly:

access_project_project,project.project,project.model_project_project,project.group_project_user,1,0,0,0

my attempt in project_security.xml :


    
        Project Manager Edit Own Project
        
        
        [('user_id', '=', user.id)]
        
        
        
        
    

But my above attempt not working as expectation. Thanks in advance



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

To give users in the project.group_project_user group edit permissions on a project if they are the project manager (i.e., if they are listed as the user_id of the project), you will need to adjust your security rules carefully.


Step 1: Create a Record Rule for the Project User Group

You need to define a record rule that grants write access to users only on projects where they are the manager (user_id).


Step 2: Modify the Access Control List (ACL) if Necessary

The existing ACL for project.group_project_user grants only read access. Since you want to allow write access based on a condition, ensure that the ACL for the project.group_project_user group


The ir.rule you added applies a filter to the project.project model, only granting write permissions (perm_write) where the user_id matches the current user's ID - user.id

This rule only applies to users in the project.group_project_user group, allowing them to edit their own projects while keeping the default read-only permissions for other projects.

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

problem solved. thanks

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 23
4
3
thg 3 25
3107
0
thg 3 25
1511
4
thg 1 25
2504
1
thg 11 24
2588