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