Accès contributeur scopé sur leurs propres publications

This commit is contained in:
2026-05-28 18:02:14 +02:00
parent d8053ac82e
commit f93fe77a12
4 changed files with 211 additions and 51 deletions

View File

@@ -97,7 +97,8 @@ class Thalim_HAL_Importer_Logic {
array $wp_users_by_hal_id = [],
string $post_status = 'pending',
bool $backdate_post = false,
array $spip_context = []
array $spip_context = [],
?int $force_post_author = null
) {
$hal_id = $hal_doc['halId_s'] ?? '';
$doc_type = $hal_doc['docType_s'] ?? '';
@@ -118,7 +119,8 @@ class Thalim_HAL_Importer_Logic {
$matched_user_names[] = $user['name'];
}
}
$post_author = !empty($matched_user_ids) ? $matched_user_ids[0] : 1;
$post_author = $force_post_author
?? (!empty($matched_user_ids) ? $matched_user_ids[0] : 1);
// --- Create the post ---
$post_args = [