\d+)', [ 'methods' => WP_REST_Server::READABLE, 'callback' => $container->get(GetNotificationController::class), 'permission_callback' => function () { return current_user_can('manage_options'); }, ] ); register_rest_route( $routeNamespace, '/notifications/(?P\d+)', [ 'methods' => WP_REST_Server::READABLE, 'callback' => $container->get(GetNotificationsController::class), 'permission_callback' => function () { return current_user_can('manage_options'); } ] ); register_rest_route( $routeNamespace, '/notification/add/', [ 'methods' => WP_REST_Server::CREATABLE, 'callback' => $container->get(AddNotificationController::class), 'permission_callback' => function () { return current_user_can('manage_options'); } ] ); register_rest_route( $routeNamespace, '/notification/update/(?P\d+)', [ 'methods' => WP_REST_Server::CREATABLE, 'callback' => $container->get(UpdateNotificationController::class), 'permission_callback' => function () { return current_user_can('manage_options'); } ] ); register_rest_route( $routeNamespace, '/notification/delete/(?P\d+)', [ 'methods' => WP_REST_Server::CREATABLE, 'callback' => $container->get(DeleteNotificationController::class), 'permission_callback' => function () { return current_user_can('manage_options'); } ] ); register_rest_route( $routeNamespace, '/notification/duplicate/(?P\d+)', [ 'methods' => WP_REST_Server::CREATABLE, 'callback' => $container->get(DuplicateNotificationController::class), // TODO - Add IvyForms capability - Admin only for now 'permission_callback' => function () { return current_user_can('manage_options'); } ] ); register_rest_route( $routeNamespace, '/notifications/search', [ 'methods' => WP_REST_Server::READABLE, 'callback' => $container->get(SearchNotificationsController::class), 'permission_callback' => function () { return current_user_can('manage_options'); } ] ); } }