code: private String[] resolvePermissions(ContainerRequest request) {
          String[] values = _permissions;
  
          if (_substitutions.isEmpty()) {
              return values;
          }
  
          String[] permissions = new String[values.length];
          System.arraycopy(values, 0, permissions, 0, values.length);
  
          for (Map.Entry<String, Function<HttpRequestContext, String>> entry : _substitutions.entrySet()) {
              String key = Pattern.quote(entry.getKey());
              String substitution = Matcher.quoteReplacement(MatchingPermission.escape(entry.getValue().apply(request)));
  
              for (int i=0; i < values.length; i++) {
                  permissions[i] = permissions[i].replaceAll(key, substitution);
              }
          }
  
          return permissions;
      }
docs: Resolves permissions based on the request.  For example, if the annotation's permission is
  "get|{thing}" and the method's @Path annotation is "/resources/{thing}" then a request to
  "/resources/table" will resolve to the permission "get|table".