Disable Add Record button when the user does not have write access to a collection #397

Open
opened 2026-11-03 10:49:08 +00:00 by venkateshhs · 1 comment
Owner

After successfully logging in through Cerebra, I tried to add a Person record and received:

Invalid token for collection platform-demo: the user is not a member of demo-curators or demo-participants.

Should the Add Record (+) button be shown when the user does not have write access to the collection?

Currently, the user can fill out the form and only learns that they lack permission when submitting it. Disabling or hiding the button earlier would avoid this false expectation. WDYT?

After successfully logging in through Cerebra, I tried to add a Person record and received: `Invalid token for collection platform-demo: the user is not a member of demo-curators or demo-participants.` Should the Add Record (+) button be shown when the user does not have write access to the collection? Currently, the user can fill out the form and only learns that they lack permission when submitting it. Disabling or hiding the button earlier would avoid this false expectation. WDYT?
Owner

This has come up before. I think the challenge is: how do we know that the user has permissions or not. Currently this happens with a submission, i.e. POST. We shouldn't be abusing POST endpoints just to check if a user has permissions to post. E.g. if they do have permission, and we just posted a dummy record, we have to deal with that cleanup. So IMO that lead to the question: should we have a dedicated auth-checking endpoint? Or some dry-run query parameter. @cmo comments?

This has come up before. I think the challenge is: how do we know that the user has permissions or not. Currently this happens with a submission, i.e. POST. We shouldn't be abusing POST endpoints just to check if a user has permissions to post. E.g. if they do have permission, and we just posted a dummy record, we have to deal with that cleanup. So IMO that lead to the question: should we have a dedicated auth-checking endpoint? Or some dry-run query parameter. @cmo comments?
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
orinoco/shacl-vue#397
No description provided.