From 0b33becbc908e01964f2152d6133c2142c451400 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 10 Apr 2019 11:05:03 +0200 Subject: [PATCH] Add warning about _tokenRestrictionIx --- src/Model/Token.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Model/Token.hs b/src/Model/Token.hs index 5b67782a5..d438965a4 100644 --- a/src/Model/Token.hs +++ b/src/Model/Token.hs @@ -68,6 +68,8 @@ makeLenses_ ''BearerToken _tokenRestrictionIx :: (FromJSON a, ToJSON a, Hashable (Route site), Eq (Route site)) => Route site -> Traversal' (BearerToken site) a -- ^ Focus a singular restriction (by route) if it exists +-- +-- This /cannot/ be used to add restrictions, use `_tokenRestrictionAt` instead _tokenRestrictionIx route = _tokenRestrictions . ix route . _JSON _tokenRestrictionAt :: (FromJSON a, ToJSON a, Hashable (Route site), Eq (Route site)) => Route site -> Traversal' (BearerToken site) (Maybe a)