I would like to restrict Role/User access to different Timesheets based on the current date.
Let’s say I have two Timesheets:
One that is 2 months old and one that is 3 days old.
The Employees should not be able to edit or view the Timesheet that is 2 months old. However, the Employees should still be able to edit the Timesheet that is 3 days old.
So per your suggestion, I have been looking into building a has_permission hook. I have a question regarding the code I am trying to build. So this code will be in the timesheet py file and needs to check the dates of each Payroll Period in the Payroll Period doctype. So my question is: is it possible to check the Payroll Period or can you only reference fields and values inside of the Timesheet doctype?