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?
Don't understand, sorry.
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.
There is nothing built into Seam to handle this specific situation.
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.