use of edu.stanford.bmir.protege.web.shared.access.BuiltInAction in project webprotege by protegeproject.
the class AbstractProjectActionHandler method getRequestValidator.
@Nonnull
@Override
public final RequestValidator getRequestValidator(@Nonnull A action, @Nonnull RequestContext requestContext) {
List<RequestValidator> validators = new ArrayList<>();
BuiltInAction builtInAction = getRequiredExecutableBuiltInAction();
if (builtInAction != null) {
ProjectPermissionValidator validator = new ProjectPermissionValidator(accessManager, action.getProjectId(), requestContext.getUserId(), builtInAction.getActionId());
validators.add(validator);
}
ActionId reqActionId = getRequiredExecutableAction();
if (reqActionId != null) {
ProjectPermissionValidator validator = new ProjectPermissionValidator(accessManager, action.getProjectId(), requestContext.getUserId(), reqActionId);
validators.add(validator);
}
Iterable<BuiltInAction> requiredExecutableBuiltInActions = getRequiredExecutableBuiltInActions();
for (BuiltInAction actionId : requiredExecutableBuiltInActions) {
ProjectPermissionValidator validator = new ProjectPermissionValidator(accessManager, action.getProjectId(), requestContext.getUserId(), actionId.getActionId());
validators.add(validator);
}
final RequestValidator additionalRequestValidator = getAdditionalRequestValidator(action, requestContext);
if (additionalRequestValidator != NullValidator.get()) {
validators.add(additionalRequestValidator);
}
return CompositeRequestValidator.get(validators);
}
Aggregations