Hi!
We have an app with several different locations.
When you open the app, you select the location. Every new record for each location will be given the correct owner through a flow.
I want the NEW item and EDIT buttons to be visible for those with the proper permissions.
The EDIT button is simple:
RecordInfo(First(Filter(Tables, Table = gal_Table.Selected.VO_Table)), RecordInfo.EditPermission)
I am struggling a bit more with the NEW button:
DataSourceInfo.CreatePermission
This will make it visible to anyone with CreatePermission and does not use any location specific data.
Is there a best practice on how to make this more specific to the location?
Does it need to be something like this?
DataSourceInfo.CreatePermission // Check if person can write to this table
&&
(
RecordInfo(First(Filter(Tables, location_lookup.LocationID = varLocation.LocationID)), RecordInfo.EditPermission) // Check if user also has edit permission to a corresponding record for the location
||
IsBlank(Filter(Tables, location_lookup.LocationID = varLocation.LocationID)) // By pass the EditPermission check if there are no records for this location yet
)
Or is there a better / simpler way to deal with it?