콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
2719 화면

I'm currently trying to set up my website to be able to serve as a platform for my community's research. I wish to do this by allowing users to create and edit their blog posts but not those of others.


Currently, I'm unable to find any way to achieve that as allowing creation and writing access to blog posts for users will instantly let them edit all other blog posts. Is there a way to achieve what I'm trying to do?

아바타
취소
베스트 답변

Hi,

To restrict users so they can only edit their own blog posts in Odoo 17 Community, you'll need to create specific access control rules and record rules. Here's a steps to achieve this:


Step 1: Create a New Security Group

1. Log in to your Odoo instance: Ensure you have administrator access.

2. Go to Settings:

   - Navigate to the Settings menu.

   - Activate the developer mode by clicking on your user profile in the top right corner and selecting Activate the developer mode.

3. Access Groups:

   - Go to Settings > Users & Companies > Groups.

   - Click on Create to create a new group.

   - Name the group, for example, "Blog Post Authors".


Step 2: Create Access Control Rules

1. Define Access Rights:

   - While creating the group, go to the Access Rights tab.

   - Add the model `blog.post` and set the permissions for Read, Write, Create and Delete as required.

2. Create Record Rules for Blog Posts:

   - Go to Settings > Technical > Security > Record Rules.

   - Click on Create to add a new record rule. 

3. Record Rule for Blog Post Authors:

   - Name: Only Own Blog Posts

   - Object: blog.post

   - Domain Filter: `[('create_uid', '=', user.id)]`

   - Groups: Select the "Blog Post Authors" group you created.

   - Permissions: Set the permissions to apply the rule for Read, Write, Create, and Delete.

4. Save the Rule:

   - Save the record rule.

Step 4: Assign Users to the New Group

1. Assign Users:

   - Go to Settings > Users & Companies > Users.

   - Select the users you want to restrict.

   - In the Access Rights tab, add them to the "Blog Post Authors" group.


Hope it helps

아바타
취소
작성자 베스트 답변

Thank you for the answers! I followed the steps in Cybrosys Techno Solutions Pvt.Ltd's answer and they work like a charm! The one downside with the setup is that users now can't even view the blog posts of other users but I'm generally fine with that as logging out will sort that out easily. Thanks for the help once again!

아바타
취소
베스트 답변

Hi,
Did you try by adding a record rule for the blog post model ?

Thanks

아바타
취소
관련 게시물 답글 화면 활동
2
6월 22
3430
2
11월 21
3166
2
2월 16
4237
0
7월 24
1153
1
7월 24
7510