Clarify WebInvocationPrivilegeEvaluator JavaDoc #16529
Labels
in: docs
An issue in Documentation or samples
status: duplicate
A duplicate of another issue
type: bug
A general bug
Milestone
When someone passes
null
for themethod
toWebInvocationPrivilegeEvaluator
, they are saying that the HTTP method doesn't matter to them for matching purposes. However, it's non-trivial to make an authorization decision in any circumstance where the relevant request matcher does require a method.Imagine the following arrangement:
When
WebInvocationPrivilegeEvaluator#isAllowed("/path", authentication)
is called, which matcher's authorization rules should it use?This happens in the more generic case as well:
Or, in other words: "if GET /path, then require USER authority; if POST | PUT | DELETE /path, then deny". Here, also, there's no way to know which the user intends, unless they also specify a method.
As such, I believe it's reasonable to require passing a method if you want method-specific request matchers to be considered, which is what the method currently does.
We should update the JavaDoc to be clearer about this, something like:
Both
isAllowed
methods should contain this clarification.The text was updated successfully, but these errors were encountered: