Created
February 11, 2013 20:54
-
-
Save mikebrock/4757530 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ApplicationScoped | |
| public class SessionManager { | |
| private boolean isAdmin = false; | |
| public boolean isAdmin() { | |
| return isAdmin; | |
| } | |
| public void setAdmin(boolean admin) { | |
| isAdmin = admin; | |
| } | |
| @Admin | |
| private void applyAdminStyle(Style style) { | |
| System.out.println("apply admin style!"); | |
| if (!isAdmin) { | |
| style.setVisibility(Style.Visibility.HIDDEN); | |
| } | |
| else { | |
| style.setVisibility(Style.Visibility.VISIBLE); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment