I am building a servlet filter plugin to filter all rest api calls to my bitbucket instance. But am kinda stuck trying to figure out how to force a 401 response if the user is not permitted to make certain requests. Any direction for this implementation will be really helpful.