diff --git a/lib/api.php b/lib/api.php
index 8d6bbb7cc09631f038d9beca6bcae25e123c7ad0..be30894b7533649f6015b3df8bf929a3313558ee 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -89,7 +89,7 @@ class OC_API {
 		$responses = array();
 		foreach(self::$actions[$name] as $action) {
 			// Check authentication and availability
-			if(!self::isAuthorised(self::$actions[$name])) {
+			if(!self::isAuthorised($action)) {
 				$responses[] = array(
 					'app' => $action['app'],
 					'response' => new OC_OCS_Result(null, OC_API::RESPOND_UNAUTHORISED, 'Unauthorised'),