use of org.apache.wicket.authroles.authorization.strategies.role.Roles 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.add(AuthorizationConstants.AUTZ_GUI_ALL_DEPRECATED_URL);
roles.addAll(actions);
if (((AuthenticatedWebApplication) AuthenticatedWebApplication.get()).hasAnyRole(roles)) {
return true;
}
return false;
}
use of org.apache.wicket.authroles.authorization.strategies.role.Roles in project midpoint by Evolveum.
the class MidPointAuthWebSession method getRoles.
@Override
public Roles getRoles() {
Roles roles = new Roles();
//todo - used for wicket auth roles...
MidPointPrincipal principal = SecurityUtils.getPrincipalUser();
if (principal == null) {
return roles;
}
for (Authorization authz : principal.getAuthorities()) {
roles.addAll(authz.getAction());
}
return roles;
}
use of org.apache.wicket.authroles.authorization.strategies.role.Roles in project ocvn by devgateway.
the class SSAuthenticatedWebSession method getRoles.
// FIXME: MZA: Modification of returning object - it would be better if
// roles were returned
@Override
public Roles getRoles() {
Roles roles = new Roles();
getRolesIfSignedIn(roles);
return roles;
}
Aggregations