Fix authorized? method

It seems like ```thresholds``` method is not the one you wanted to use.

I replaced it by ```environments``` method.