@GET
  @Produces({"text/html"})
  public Response getRestricted() throws IOException{

    String userName = context.getUsername();

    try {
      context.hasPermission(userName, "RESTRICTED");
    } catch (org.apache.ambari.view.SecurityException e) {
      return Response.status(401).build();
    }

    return Response.ok("<b>You have accessed a restricted resource.</b>").type("text/html").build();
  }
Handles: GET /restricted.

@return the response
ambari-views/examples/restricted-view/src/main/java/org/apache/ambari/view/restricted/RestrictedResource.java