Restrict employee to see only his/her details

Hi,

If a user has “Employee Read” role which includes the permission “perm.rr.Employee.r” then the user is able to read all the employees. Is it possible to add a condition to the permission so that the employee can see only his/her details and not others?

What will be that condition?

Yes you can add condition like self.user.id = ? and on condition parameter add user.id

Thank you team. This has helped me to solve the primary need.

Following up on this, how do we allow the user to update only the Personal Information but NOT the HR Information.

Similarly user should be able to add/remove Skills, but nothing in Employment Contract

For field specific permission use field permission , for more details check https://docs.axelor.com/adk/5.2/dev-guide/modules/security.html#view-access

I ended up creating a new view and the corresponding action (by duplicating the existing ones) , marked the panels as read only (readonly=true) and it served the purpose. Not sure if this the right approach but it seems to have worked the way I wanted.

Its fine to create new view if conditions are limited and view is not much complex.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.