Home > Guides > Core Developers Guide > Interceptors > Roles Interceptor |

Apache Struts 2 Documentation
Roles Interceptor
Edit Page Browse Space Add Page Add News

This interceptor ensures that the action will only be executed if the user has the correct role.

## Parameters

- allowedRoles - a comma-separated list of roles to allow

- disallowedRoles - a comma-separated list of roles to disallow

When both allowedRoles and disallowedRoles are configured, then disallowedRoles takes precedence, applying the following logic: (if ((inRole(role1) || inRole(role2) || ... inRole(roleN)) && !inRole(roleA) && !inRole(roleB) && ... !inRole(roleZ)) { //permit ...

## Examples