PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.0
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.0
2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.2 All 57 releases
← All changes | includes/Traits/SecurityTrait.php +2 -1 2.2.02.4.0 View file →
@@ -33,9 +33,10 @@
33 33 * @param string $capability The required capability, defaults to manage_options
34 34 * @return bool|WP_Error True if has capability, WP_Error otherwise
35 35 */
36 36 protected function checkCapability($capability = 'manage_options') {
37 - if (!current_user_can($capability)) {
37 + $allowed = function_exists('easy_invoice_user_can') ? easy_invoice_user_can($capability) : current_user_can($capability);
38 + if (!$allowed) {
38 39 return new \WP_Error('invalid_capability', __('You do not have permission to perform this action.', 'easy-invoice'));
39 40 }
40 41
41 42 return true;