Adding access security
When adding a new data model, you need to define who can create, read, update, and delete records. When creating a totally new application, this can involve defining new user groups. Consequently, if a user doesn’t have these access rights, then Odoo will not display your menus and views. In the previous recipe, we accessed our menu by converting an admin user into a superuser. After completing this recipe, you will be able to access menus and views for the Hostel module directly as an admin user.
This recipe builds on the Hostel model from the previous recipes and defines a new security group of users to control who can access or modify the records of Hostel.
Getting ready
The add-on module that implements the hostel.hostel model, which was provided in the previous recipe, is needed because, in this recipe, we will add the security rules for it. The paths that are used are relative to our add-on module location (for example, ~/odoo-dev/local...