| @@ -4,8 +4,9 @@ | ||
| 4 | 4 | |
| 5 | 5 | use IvyForms\Common\Exceptions\ForbiddenException; |
| 6 | 6 | use IvyForms\Common\Sanitizer\Sanitizer; |
| 7 | 7 | use IvyForms\Services\API\IvyFormsAPI; |
| 8 | +use IvyForms\Services\Permissions\IvyFormsAccess; | |
| 8 | 9 | use stdClass; |
| 9 | 10 | use WP_Post; |
| 10 | 11 | |
| 11 | 12 | /** |
| @@ -102,9 +103,9 @@ | ||
| 102 | 103 | 403 |
| 103 | 104 | ); |
| 104 | 105 | } |
| 105 | 106 | |
| 106 | - if (!current_user_can('manage_options')) { | |
| 107 | + if (!IvyFormsAccess::canAccessFormPreview()) { | |
| 107 | 108 | wp_die( |
| 108 | 109 | esc_html__('Sorry, you are not allowed to visit this preview form as this user.', 'ivyforms'), |
| 109 | 110 | esc_html__('You need a higher level of permission.', 'ivyforms'), |
| 110 | 111 | 403 |