Package com.priint.pubserver.auth
Annotation Type RequiresRoles
-
@Target({TYPE,METHOD}) @Retention(RUNTIME) public @interface RequiresRolesThe RequiresRoles annotation requires the current Subject to have all of the specified roles. If they do not have the role(s), the method will not be executed and an AuthorizationException is thrown. The logical operation for the permission check in case multiple roles are specified. AND is the default.For example:
@RequiresRoles({"Administrator"}) public void createAccount(Account account) { //this method will only be invoked by an admin }
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String[]valueA single String role name or multiple comma-delimited role names required in order for the method invocation to be allowed.
-