}
@Override
public GenericPermissionVoter create(Bean<GenericPermissionVoter> bean,
CreationalContext<GenericPermissionVoter> creationalContext) {
GenericPermissionVoter result = super.create(bean, creationalContext);
// We can't move this to the Extension itself.
// The producer of this PermissionLookup goes to the database and this isn't possible until we are completely ready.
PermissionLookup<? extends NamedPermission> permissionLookup = CDIUtil.getBeanManually(PermissionLookup.class);
if (permissionLookup == null) {
throw new OctopusConfigurationException("When using the named permissions, please configure them with the PermissionLookup. See manual ??? TODO");
}
result.setNamedPermission(permissionLookup.getPermission(namedPermission.name()));
return result;
}