| @@ -20,9 +20,9 @@ | ||
| 20 | 20 | public function __construct() { |
| 21 | 21 | $this->actions = array( |
| 22 | 22 | 'get_demo_list' => array( |
| 23 | 23 | 'callback' => array( $this, 'get_demo_list' ), |
| 24 | - 'capability' => 'manage_options', | |
| 24 | + 'capability' => 'ablocks_import_templates', | |
| 25 | 25 | 'fields' => array( |
| 26 | 26 | 'type' => 'string', |
| 27 | 27 | 'cost_type' => 'string', |
| 28 | 28 | 'page' => 'integer', |
| @@ -33,9 +33,9 @@ | ||
| 33 | 33 | ) |
| 34 | 34 | ), |
| 35 | 35 | 'get_single_demo' => array( |
| 36 | 36 | 'callback' => array( $this, 'get_single_demo' ), |
| 37 | - 'capability' => 'manage_options', | |
| 37 | + 'capability' => 'ablocks_import_templates', | |
| 38 | 38 | 'fields' => array( |
| 39 | 39 | 'id' => 'integer', |
| 40 | 40 | 'with_images' => 'string', |
| 41 | 41 | ) |
| @@ -41,9 +41,9 @@ | ||
| 41 | 41 | ) |
| 42 | 42 | ), |
| 43 | 43 | 'get_demo_categories' => array( |
| 44 | 44 | 'callback' => array( $this, 'get_demo_categories' ), |
| 45 | - 'capability' => 'manage_options', | |
| 45 | + 'capability' => 'ablocks_import_templates', | |
| 46 | 46 | 'fields' => array( |
| 47 | 47 | 'type' => 'string', |
| 48 | 48 | ) |
| 49 | 49 | ), |
| @@ -48,13 +48,13 @@ | ||
| 48 | 48 | ) |
| 49 | 49 | ), |
| 50 | 50 | 'get_theme_demos' => array( |
| 51 | 51 | 'callback' => array( $this, 'get_theme_demos' ), |
| 52 | - 'capability' => 'manage_options', | |
| 52 | + 'capability' => 'ablocks_import_templates', | |
| 53 | 53 | ), |
| 54 | 54 | 'check_dependencies' => array( |
| 55 | 55 | 'callback' => array( $this, 'check_dependencies' ), |
| 56 | - 'capability' => 'manage_options', | |
| 56 | + 'capability' => 'ablocks_import_templates', | |
| 57 | 57 | 'fields' => array( |
| 58 | 58 | 'dependencies' => 'array|string', |
| 59 | 59 | ) |
| 60 | 60 | ), |
| @@ -59,9 +59,12 @@ | ||
| 59 | 59 | ) |
| 60 | 60 | ), |
| 61 | 61 | 'install_and_active' => array( |
| 62 | 62 | 'callback' => array( $this, 'install_and_active' ), |
| 63 | - 'capability' => 'manage_options', | |
| 63 | + // A demo's dependencies are plugins. Importing templates is a | |
| 64 | + // design permission; installing plugins is not, and must never | |
| 65 | + // become reachable through one. | |
| 66 | + 'capability' => 'install_plugins', | |
| 64 | 67 | 'fields' => array( |
| 65 | 68 | 'dependency' => 'array|string', |
| 66 | 69 | ) |
| 67 | 70 | ), |
| @@ -66,9 +69,9 @@ | ||
| 66 | 69 | ) |
| 67 | 70 | ), |
| 68 | 71 | 'import_template' => array( |
| 69 | 72 | 'callback' => array( $this, 'import_template' ), |
| 70 | - 'capability' => 'manage_options', | |
| 73 | + 'capability' => 'ablocks_import_templates', | |
| 71 | 74 | 'fields' => array( |
| 72 | 75 | 'file_url' => 'string', |
| 73 | 76 | 'customizer_file_url' => 'string', |
| 74 | 77 | 'widget_file_url' => 'string', |