Define manage automation capability in automation code

[MAILPOET-4465]
This commit is contained in:
Jan Jakes
2022-07-05 12:59:33 +02:00
committed by Veljko V
parent a073f05ffe
commit 7df8342a18
3 changed files with 6 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
namespace MailPoet\Automation\Engine\API;
use MailPoet\Config\AccessControl;
use MailPoet\Automation\Engine\Engine;
use MailPoet\Validator\Schema;
use function current_user_can;
@@ -11,7 +11,7 @@ abstract class Endpoint {
abstract public function handle(Request $request): Response;
public function checkPermissions(): bool {
return current_user_can(AccessControl::PERMISSION_MANAGE_AUTOMATIONS);
return current_user_can(Engine::CAPABILITY_MANAGE_AUTOMATIONS);
}
/** @return array<string, Schema> */