title: How to limit access for User and show specific menu parts?
body: <p>I have a component where through map I show all menu parts. How can I limit access(make it hidden) if user right for that part of menu is equal to 0?</p>
  <pre><code>  const Aside: React.FunctionComponent = () =&gt; {
    const[hasRight, setHasRight] = useState(false);
  
    useEffect( () =&gt; {
      getUserContext()
        .then((response) =&gt; {
          Object.keys(response.data.acl.rights).forEach(role =&gt; {
            const right = response.data.acl.rights[role];
            Object.keys(right).forEach(val =&gt; {
              right[val] &gt; 0 ?
              setHasRight(true) :
              setHasRight(false);
            });
          });
          return response.data.acl;
        })
    }, [hasRight]);
    return (
      &lt;div className=&quot;Aside&quot;&gt;
        {hasRight?
          pages.map((page, index) =&gt; {
            return (
              &lt;Link className=&quot;Aside__link&quot; key={index} to={page.link}&gt;
                &lt;img className=&quot;Aside__link-image&quot; src={page.img} alt=&quot;page__img&quot; /&gt;
                &lt;p&gt;{page.title}&lt;/p&gt;
              &lt;/Link&gt;
            );
        }): null}
      &lt;/div&gt;
    );
  };
  </code></pre>
  <p>In this part I hide all menu if it does not have access. I need to check each menu item to see if there is access to it.</p>