1 Reply Latest reply on Dec 7, 2007 5:23 AM by Ryszard Kozmik

    How to make an

    Daniel Gallot Newbie

      Hi

      I would like to give the right to access to two or three categories.
      For one category, the following acl-permissions works fine :

      <permission action="readCategory">
       <criteria for="readCategory://ui">param[0].title.toLowerCase().startsWith('category 1')</criteria>
      </permission>


      If I had a second criteria, it does not work :
      <permission action="readCategory">
       <criteria for="readCategory://ui">param[0].title.toLowerCase().startsWith('category 1')</criteria>
       <criteria for="readCategory://ui">param[0].title.toLowerCase().startsWith('category 2')</criteria>
      </permission>

      The "category 2" is not made accessible : the first criteria is applied, the second one does not have effect any more.

      So I would like to declare something like that :
      <permission action="readCategory">
       <criteria for="readCategory://ui">param[0].title.toLowerCase().startsWith('category 1') or param[0].title.toLowerCase().startsWith('category 2')</criteria>
      </permission>


      Is it possible ?

      Thanks a lot for your reply


        • 1. Re: How to make an
          Ryszard Kozmik Master

          Hello

          Probably it isn't. Even if, I would try it with '||' not 'or'. Nevertheless, I believe you can use

          param[0].title.toLowerCase().matches('category\s[12]')

          I didn't test it but should work.

          Regards
          -------------------
          Ryszard Kozmik
          JBoss Forums Lead
          JBoss Labs Team