Hi,
I have a collection that I would like different type of users to read different records (based on one of the fields in the record - just like a simple where in SQL).
I have actually two questions -
- how do I do the AND in the language (&& doesnt work). I suppose that the concatenating the where statements could do that, but it is not readable at all, is there any better way to do it?
- is there any other way to specify which records could be read by people (for instance user type A can read all the records with the status A, while the user type B can read only the records specified with B)
Example:
'Requests': collection ['Request ID'] {
can-read: user .'Type'?'Admin'
|| where ( user .'Type'?'A'
where ( .'Status'?'Other'
where ( user is ( >'User' ) ) ) )
→ I suppose that here, either the Admin can read everything, or the user of type A, where the status is Other and where the currently assigned user to the task is him right?