Accès contributeur scopé sur leurs propres publications
This commit is contained in:
@@ -58,13 +58,31 @@ class Thalim_HAL_Importer {
|
||||
}
|
||||
|
||||
public function add_admin_menu() {
|
||||
add_management_page(
|
||||
'HAL Import',
|
||||
'HAL Import',
|
||||
'edit_others_posts',
|
||||
'thalim-hal-importer',
|
||||
[$this, 'render_admin_page']
|
||||
);
|
||||
// Admins/editors : page sous Outils (UI complète : filtres tous auteurs, debug, etc.)
|
||||
if (current_user_can('edit_others_posts')) {
|
||||
add_management_page(
|
||||
'HAL Import',
|
||||
'HAL Import',
|
||||
'edit_others_posts',
|
||||
'thalim-hal-importer',
|
||||
[$this, 'render_admin_page']
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Contributeurs : menu top-level dédié (Outils est masqué pour eux par le thème).
|
||||
// La classe rend une UI réduite scopée sur leur idHAL en interne.
|
||||
if (current_user_can('edit_posts')) {
|
||||
add_menu_page(
|
||||
'Importer depuis HAL',
|
||||
'Importer depuis HAL',
|
||||
'edit_posts',
|
||||
'thalim-hal-import-mine',
|
||||
[$this, 'render_admin_page'],
|
||||
'dashicons-download',
|
||||
26
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function render_admin_page() {
|
||||
|
||||
Reference in New Issue
Block a user