How does AccessResult::neutral() work? I have seen in code:

AccessResult::neutral()
AccessResult::allowed()
AccessResult::forbidden()


allowed() and forbidden() are pretty obvious, but how does neutral() work?

I have been debugging and sometimes neutral() allow access and sometimes it doesn't.
“Neutral” basically means “I don’t care” in this context.

Returning it means you’re saying that your code has no opinion on whether access should be granted or not, and that other methods/modules should make the decision.