true, // Die Rolle kann Beiträge lesen 'edit_posts' => true, // Die Rolle kann Beiträge bearbeiten 'delete_posts' => true, // Die Rolle kann Beiträge löschen 'publish_posts' => true, // Die Rolle kann Beiträge veröffentlichen // Weitere Berechtigungen können nach Bedarf hinzugefügt werden ); // Rolle hinzufügen add_role( 'stafue', 'Stammesführung', kompass_get_capa_stafue() ); add_role( 'grufue', 'Gruppenführung', kompass_get_capa_grufue() ); add_role( 'aktionsleitung', 'Aktionsleitung', kompass_get_capa_aktionsleitung() ); add_role( 'author', 'Redakteur', kompass_get_capa_editor() ); $role = get_role( 'administrator' ); foreach (kompass_get_capa_stafue() as $capability => $value) { $role->add_cap( $capability ); } } function kompass_get_capa_stafue() : array { return array_merge( [ 'create_groups' => true, 'delete_groups' => true, 'edit_groups' => true, 'delete_teilis' => true, 'move_teilis' => true, 'create_events' => true, ], kompass_get_capa_aktionsleitung(), kompass_get_capa_grufue(), kompass_get_capa_editor()); } function kompass_get_capa_aktionsleitung() : array { return [ 'show_bdp' => true, 'create_event_teilis' => true, 'edit_event_teilis' => true, 'delete_event_teilis' => true, 'send_event_mails' => true, ]; } function kompass_get_capa_grufue() : array { return [ 'show_bdp' => true, 'show_groups' => true, 'create_teilis' => true, 'edit_teilis' => true, 'send_mails' => true ]; } function kompass_get_capa_editor() : array { return [ 'moderate_comments' => true, 'manage_categories' => true, 'manage_links' => true, 'upload_files' => true, 'unfiltered_html' => true, 'edit_posts' => true, 'edit_others_posts' => true, 'edit_published_posts' => true, 'publish_posts' => true, 'edit_pages' => true, 'read' => true, 'level_7' => true, 'level_6' => true, 'level_5' => true, 'level_4' => true, 'level_3' => true, 'level_2' => true, 'level_1' => true, 'level_0' => true, 'edit_others_pages' => true, 'edit_published_pages' => true, 'publish_pages' => true, 'delete_pages' => true, 'delete_others_pages' => true, 'delete_published_pages' => true, 'delete_posts' => true, 'delete_others_posts' => true, 'delete_published_posts' => true, 'delete_private_posts' => true, 'edit_private_posts' => true, 'read_private_posts' => true, 'delete_private_pages' => true, 'edit_private_pages' => true, 'read_private_pages' => true, ]; }