Search in sources :

Example 1 with AuthenticatedWebApplication

use of org.apache.wicket.authroles.authentication.AuthenticatedWebApplication in project midpoint by Evolveum.

the class WebComponentUtil method isAuthorized.

public static boolean isAuthorized(Collection<String> actions) {
    if (actions == null || actions.isEmpty()) {
        return true;
    }
    Roles roles = new Roles(AuthorizationConstants.AUTZ_ALL_URL);
    roles.add(AuthorizationConstants.AUTZ_GUI_ALL_URL);
    roles.addAll(actions);
    return ((AuthenticatedWebApplication) AuthenticatedWebApplication.get()).hasAnyRole(roles);
}
Also used : AuthenticatedWebApplication(org.apache.wicket.authroles.authentication.AuthenticatedWebApplication) Roles(org.apache.wicket.authroles.authorization.strategies.role.Roles) PageRoles(com.evolveum.midpoint.web.page.admin.roles.PageRoles)

Aggregations

PageRoles (com.evolveum.midpoint.web.page.admin.roles.PageRoles)1 AuthenticatedWebApplication (org.apache.wicket.authroles.authentication.AuthenticatedWebApplication)1 Roles (org.apache.wicket.authroles.authorization.strategies.role.Roles)1