4 Replies Latest reply on Jan 1, 2008 9:51 PM by shane.bryzak

    rights to see a buton

    marx3

      How properly implement visibility of button based on role/rights. Should I fill 'rendered' attribute? What, if i see a page with button and somebody will hold my rights to press this button and I will click it? I would like to refresh page, hide button and display message. Can it be done automatically by Seam?

        • 1. Re: rights to see a buton
          pmuir

           

          "Marx3" wrote:
          How properly implement visibility of button based on role/rights. Should I fill 'rendered' attribute?


          Yes

          What, if i see a page with button and somebody will hold my rights to press this button and I will click it? I would like to refresh page, hide button and display message. Can it be done automatically by Seam?


          Don't understand, sorry.

          • 2. Re: rights to see a buton
            marx3

            1)i'm opening a page with a button. Now i have rights to see and click it.
            2)Somebody revokes my right to click this button, but I still see it because page has been opened before.
            3)I'm clicking button

            For now page refreshes without any info (button of course isn't visible after refresh) which is misleading for user. I would like to inform user that he hasn't enough rights to click button.

            • 3. Re: rights to see a buton
              pmuir

              There is nothing built into Seam to handle this specific situation.

              • 4. Re: rights to see a buton
                shane.bryzak

                If you put a @Restrict on your action method with the same security expression as your button then it will throw an AuthorizationException if the security check fails when the button is clicked.