Skip to content

Instantly share code, notes, and snippets.

@runeflobakk
Created October 30, 2011 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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