diff --git a/html/pages/api-access.inc.php b/html/pages/api-access.inc.php
index 9e815c5af3..07e297b10f 100644
--- a/html/pages/api-access.inc.php
+++ b/html/pages/api-access.inc.php
@@ -12,7 +12,7 @@
* the source code distribution for details.
*/
-if ($_SESSION['userlevel'] >= '10') {
+if (is_admin() === true) {
if (empty($_POST['token'])) {
$_POST['token'] = bin2hex(openssl_random_pseudo_bytes(16));
}
@@ -54,7 +54,7 @@ if ($_SESSION['userlevel'] >= '10') {