Skip to content

Instantly share code, notes, and snippets.

@mikebrock
Created February 11, 2013 20:54
Show Gist options
  • Select an option

  • Save mikebrock/4757530 to your computer and use it in GitHub Desktop.

Select an option

Save mikebrock/4757530 to your computer and use it in GitHub Desktop.
@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