Search in sources :

Example 1 with UnauthorizedActionException

use of org.apache.struts.chain.commands.UnauthorizedActionException in project sonarqube by SonarSource.

the class TestAuthorizeAction method testNotAuthorizedOneRole.

public void testNotAuthorizedOneRole() throws Exception {
    ActionConfig config = new ActionConfig();
    config.setPath("/testNotAuthorizedOneRole");
    config.setRoles("roustabout");
    this.saContext.setActionConfig(config);
    try {
        boolean result = command.execute(saContext);
    } catch (UnauthorizedActionException ex) {
    }
}
Also used : ActionConfig(org.apache.struts.config.ActionConfig) UnauthorizedActionException(org.apache.struts.chain.commands.UnauthorizedActionException)

Example 2 with UnauthorizedActionException

use of org.apache.struts.chain.commands.UnauthorizedActionException in project sonar-java by SonarSource.

the class TestAuthorizeAction method testNotAuthorizedOneRole.

public void testNotAuthorizedOneRole() throws Exception {
    ActionConfig config = new ActionConfig();
    config.setPath("/testNotAuthorizedOneRole");
    config.setRoles("roustabout");
    this.saContext.setActionConfig(config);
    try {
        boolean result = command.execute(saContext);
    } catch (UnauthorizedActionException ex) {
    }
}
Also used : ActionConfig(org.apache.struts.config.ActionConfig) UnauthorizedActionException(org.apache.struts.chain.commands.UnauthorizedActionException)

Example 3 with UnauthorizedActionException

use of org.apache.struts.chain.commands.UnauthorizedActionException in project sonarqube by SonarSource.

the class TestAuthorizeAction method testNotAuthorizedOneOfManyRoles.

public void testNotAuthorizedOneOfManyRoles() throws Exception {
    ActionConfig config = new ActionConfig();
    config.setPath("/testNotAuthorizedOneOfManyRoles");
    config.setRoles("roustabout,memory");
    this.saContext.setActionConfig(config);
    try {
        boolean result = command.execute(saContext);
    } catch (UnauthorizedActionException ex) {
    }
}
Also used : ActionConfig(org.apache.struts.config.ActionConfig) UnauthorizedActionException(org.apache.struts.chain.commands.UnauthorizedActionException)

Example 4 with UnauthorizedActionException

use of org.apache.struts.chain.commands.UnauthorizedActionException in project sonar-java by SonarSource.

the class TestAuthorizeAction method testNotAuthorizedOneOfManyRoles.

public void testNotAuthorizedOneOfManyRoles() throws Exception {
    ActionConfig config = new ActionConfig();
    config.setPath("/testNotAuthorizedOneOfManyRoles");
    config.setRoles("roustabout,memory");
    this.saContext.setActionConfig(config);
    try {
        boolean result = command.execute(saContext);
    } catch (UnauthorizedActionException ex) {
    }
}
Also used : ActionConfig(org.apache.struts.config.ActionConfig) UnauthorizedActionException(org.apache.struts.chain.commands.UnauthorizedActionException)

Aggregations

UnauthorizedActionException (org.apache.struts.chain.commands.UnauthorizedActionException)4 ActionConfig (org.apache.struts.config.ActionConfig)4