Skip to content

Instantly share code, notes, and snippets.

@runeflobakk
Created October 30, 2011 20:36
Show Gist options
  • Save runeflobakk/1326397 to your computer and use it in GitHub Desktop.
Save runeflobakk/1326397 to your computer and use it in GitHub Desktop.
Vi har en eller flere støttede ConfigAttributes, og sjekker om det finnes en som aksepterer sikkerhetsnivået til principalen.
Object p = authentication.getPrincipal();
if (p instanceof MyPrincipal
&& exists(supportedAttributes, new AcceptingSecurityLevelOf((MyPrincipal) p))) {
return ACCESS_GRANTED;
} else {
return ACCESS_DENIED;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment