]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/BaseApi.php
Merge pull request #10962 from annando/db-doc
[friendica.git] / src / Module / BaseApi.php
index 3e6f8a2a2a9fc90e28fda7e42057694607efa2a8..5b44073f3f6ce4bfee39194aa00c858517a476de 100644 (file)
@@ -75,9 +75,7 @@ class BaseApi extends BaseModule
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
-               $a = DI::app();
-
-               if (empty($a->getUserId()) || $a->getUserId() != self::getCurrentUserID()) {
+               if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
        }
@@ -86,9 +84,7 @@ class BaseApi extends BaseModule
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
-               $a = DI::app();
-
-               if (empty($a->getUserId()) || $a->getUserId() != self::getCurrentUserID()) {
+               if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
        }
@@ -97,9 +93,7 @@ class BaseApi extends BaseModule
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
-               $a = DI::app();
-
-               if (empty($a->getUserId()) || $a->getUserId() != self::getCurrentUserID()) {
+               if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
        }
@@ -108,9 +102,7 @@ class BaseApi extends BaseModule
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
-               $a = DI::app();
-
-               if (empty($a->getUserId()) || $a->getUserId() != self::getCurrentUserID()) {
+               if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
        }