I’m using Appsheet to build a solution for a company I work for - taking our timesheets digital! One of the problems I have with this is with permissions as the timesheets go through the review process. To illustrate this, here’s basically the three stages.
- Employee has a timesheet. He can edit the date when he creates the new timesheet. Once a new timesheet has been created, he can create many Line Items under that time sheet. So 1 Timesheet might have 4 line items which are basically job number, time, work code.
To be clear, Timesheets are in one table, line items are in another table. Each line item is tied to a specific timesheet with a TimeSheetID.
In order to do this, the Line Items must be editable. HE has to be able to add, update, delete the line items in Today’s time sheet. At this point I have a Column (Status) which reads Draft.
At the end of the day, the employee clicks the Submit button.
- Once the employee clicks Submit, the status is changed from Draft to Submitted. Here’s where I’m having trouble. Since the employee submitted the timesheet, I still want him to be able to view it, but I do NOT want him to be able to edit any of the line items. My solution to this was to create a slice called Submitted, that retrieved the employees Timesheets with Status Submitted, as Read Only. Unfortunately, I’ve found that “Read Only” permission doesn’t cascade down to the Line Items. The employee can no longer edit the date on the time sheet (Great), but can still edit the line items. Needless to say this isn’t how I want the Timesheet to work.
How would I allow an employee to view his submitted timesheets, but not be able to edit any referenced line items once the status on the Timesheet has been changed to submitted?