How to Create Security Group & Manage Access Rights in Odoo 18

December 12, 2024 by
admin


                                                                                                                 


How to Create Security Group & Manage Access Rights in Odoo 18

Overview
Security Groups are used to define a set of permissions and control access to certain functionalities. Users are assigned to security groups, and these groups determine the actions they can perform on specific records, such as read, write, create, and delete.Access rights define what actions a user can perform on a model or object, such as reading, writing, creating, or deleting records.
The Security Groups and Access Rights functionality in Odoo 18 allows administrators to easily regulate who has the ability to access, alter, or remove data in different modules. Managing user access properly ensures that data remains secure, confidential, and that collaboration within the system is streamlined and efficient.


Configuration
  • The first step is to create a security folder inside our custom module. This folder will contain the definitions for security access and security groups.


  • The ir.model.access.csv file consists of the columns id, name, model_id:id, group_id:id, perm_read, perm_write, perm_create, and perm_unlink. Each record in the file corresponds to a record in the ir.model.access model. For example, the id is access_customer_portal, the name is access.customer.portal, and the model name is model_customer_portal. The model name follows a format where model_ is prefixed and dots are replaced with underscores. The group_id field is left blank to allow all groups to access the model. The final four columns represent the permissions for read, write, create, and delete, with 0 indicating that the permission is denied for that group.
  • view access rights via the UI under Settings > Technical > Access Rights.



Open view of access rights



  • ir.model.access.csv file by not including the group.


  • Without adding group all the users have the access rights


  • When here added a group called customer portal and We assign this group to the Administration category.
  • After creating the security group then add it into the manifest file
  • To grant users access to the group, head to Settings > Users & Companies > Groups, and find the group using the search bar.


  • When open the groups form view we can add the users to the particular group


  • Once the security group is created and users are assigned, we need to set restrictions for this group in terms of model access. Ensure the access rule in the ir.model.access.csv file reflects this by including the group.
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_customer_portal_task,access_customer_portal_task,project.model_project_task,customer_portal_group,1,0,0,0


  • The customer portal group is created added the menu called customer details into the group users
  • Here the allowed user is admin
  • After adding the group to the access rule, the menu should still be visible to Mitchell Admin who belongs to the group



  • Upon logging in as Marc Demo, who is not a member of the group, the relevant records should be inaccessible, as access is restricted to group members only


Conclusion
managing groups and access rights in Odoo 18 is essential for maintaining a secure and efficient workflow within an organization. By creating custom security groups and defining specific access rights, businesses can ensure that sensitive data is protected and only accessible to authorized users. Properly assigning users to the appropriate groups based on their roles further streamlines operations and enhances security.


If you are looking for an ERP implementation partner with diverse industry experience feel free to contact us. We have proven track record of successful implementations across various sectors including Odoo for Manufacturing, Odoo for Trading, Odoo for FMCG, Odoo for Oil & Gas, Odoo for Diary, Odoo for Pharma, Odoo for Cosmetic Clinic, Odoo for Contracting Companies, Odoo for HVAC, Odoo for Logistics, Odoo for Automobile, Odoo for Laundry, Odoo for Field Service, Odoo for E-Commerce & many more


ZestyBeanz offers Developer / Consultant outsourcing programs, Chat with us in Whatsapp and Hire Odoo Developers, Mobile Application Developers, Consultants.
#OdooKerala #OdooKochi #OdooTrivandrum #OdooERP #ProjectManagement #OdooVansales #HireOdooDeveloper
# Odoo