Rothamsted-Ecoinformatics / farm_rothamsted

Custom farmOS features for Rothamsted Research.
GNU General Public License v2.0
6 stars 1 forks source link

Permissions: updating restricted viewer to inlcude 'owned' assets and logs #575

Open aislinnpearson opened 1 year ago

aislinnpearson commented 1 year ago

When creating the restricted viewer role in issue #373 we realised it works well if the restricted viewer is associated with the experiment, but it doesn't allow them to see assets or logs that they own.

This could be useful if we had external clients who have an interest in a crop asset - they could be named as an owner of that asset and see all its management logs. This got a bit complex to implement in issue #373 and so is kept here for future consideration.

paul121 commented 11 months ago

This is an interesting idea and could potentially be a general farmOS contribution if we do use the owner field. But I do kinda worry that this might be misuse of the owner field. For example, our quick forms use the owner field to store the Operator that completed the job. If we add other people to this same field for the purpose of data access, it may become unclear who really completed the job. I know we are thinking about assets not logs here, but same may apply.

Instead, there could be a new field dedicated to granting individual users access to things eg: asset.user_access.

The other general issue with this is that you need to add individual users to grant access to each thing. It would be convenient if you could allow a "group" of users to all have access, and then add/remove users from that group over time, instead of add/remove from each individual asset.

paul121 commented 11 months ago

Today we talked about an important use-case for this: Leo might be entering historical data and be listed as the "Author" of the log, but Leo also specifies who the "Owner" is that completed the log. This "Owner" user should have access to edit the log and correct it/make changes as needed. This use case makes sense to me.

This could be useful if we had external clients who have an interest in a crop asset - they could be named as an owner of that asset and see all its management logs.

This use-case doesn't seem as ideal to me... but of course if this were implemented, it could be used this way. It just means the "Owner" field now has multiple meanings.