Are HTTP OPTIONS
requests appropriate to determine a user's authorization?
I have seen HTTP OPTIONS
requests used for preflight to check if a request is valid, but is it okay to use it to determine what access a user has to a specific resource?
Use case
A resource is display on a page. There is an edit form uses PUT
to update the resource. If a request to OPTIONS /resource/1
shows it accepts PUT
, an edit button is displayed.
Questions
Is an
OPTIONS
request suitable to the return the verbs that a specific user has access to determine authorization/permissions?Should
OPTIONS
requests header information be used in frontend code (or just preflight vaidation)?Are there any standards for determining an authenticated user's permissions via REST API?