3 Replies Latest reply on Jan 31, 2018 7:12 PM by MarkLarvo

    Hide Child Panel for Not Role OR Not Team?

    MarkLarvo Specialist

      Happy Friday!

       

      We have successfully used the Hidden Expression for a Child Panel using $(CurrentUserRole() != "Admin)

      - (Hide if role is not Admin)

       

      I have also tested $(!CurrentUserInTeam("Server Operations")

      - (Hide if user is not in the team Server Operations)

       

      When I combine the two only the CurrentUserRole (2nd part of expression after the OR) works.

       

      $(!CurrentUserInTeam("Server Operations") || CurrentUserRole() != "Admin")

       

      So each works independently but not together. Any thoughts on making this work?

        • 1. Re: Hide Child Panel for Not Role OR Not Team?
          Terry Douglas Employee

          Hi Mark,

           

          Happy Monday!

           

          TLDR: Does

               $(!CurrentUserInTeam("Server Operations") && CurrentUserRole() != "Admin")

          do what you want?

           

          I love (read: hate) these logic puzzles. With negation and 'hidden when' rather than 'show when', it gets confusing quickly. For me, that means it's Venn diagram time.

           

          When do you want the Child Panel to be shown?

          What your expression currently says is, only show the panel to Admins who are in the Server Operations team. I tested this and it works on my machine.

           

           

          I suspect what you want is to only show the panel to Admins, or members of the Server Operations team. Negating this into a hidden expression, hide when not an Admin AND (&&) not a member of Server Operations.

           

           

          Hope this helps!

          • 2. Re: Hide Child Panel for Not Role OR Not Team?
            MarkLarvo Specialist

            OMG! Terry!

             

            Thank you. What a beautifully documented answer. This was very helpful and I appreciate you reminding me that this is a double or triple negative sort of situation.

             

            Thanks for the quick reply! Mark.

            • 3. Re: Hide Child Panel for Not Role OR Not Team?
              MarkLarvo Specialist

              For those that might read this thread later, we have discovered the 2017.2 appears to have a bug with $(CurrentUserInTeam()) when the team name has an & in it.

               

              $(CurrentUserRole() != "Admin" && !CurrentUserInTeam("Server & Network Operations"))

               

              Does NOT work in 2017.2. It will work in 2015.2

               

              Reported to Ivanti today. Case: 1407061