Make BaseApi->checkAllowedScope into an object method

- It isn't called from static contexts anymore
This commit is contained in:
Hypolite Petovan 2023-10-11 09:30:42 -04:00
parent f70a64891c
commit 9e71610711
131 changed files with 152 additions and 152 deletions

View File

@ -45,7 +45,7 @@ class Inbox extends BaseApi
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$page = $request['page'] ?? null;

View File

@ -58,7 +58,7 @@ class Outbox extends BaseApi
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$postdata = Network::postdata();

View File

@ -38,7 +38,7 @@ class Whoami extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$owner = User::getOwnerDataById($uid);

View File

@ -44,7 +44,7 @@ class Activity extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -34,7 +34,7 @@ class Create extends BaseApi
{
protected function post(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
// params

View File

@ -34,7 +34,7 @@ class Delete extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -35,7 +35,7 @@ class Show extends BaseApi
{
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
$type = $this->getRequestValue($this->parameters, 'extension', 'json');

View File

@ -35,7 +35,7 @@ class Update extends BaseApi
{
protected function post(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
// params

View File

@ -54,7 +54,7 @@ class Search extends BaseApi
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -32,7 +32,7 @@ class Setseen extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -40,7 +40,7 @@ class Create extends BaseApi
{
protected function post(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
// params

View File

@ -35,7 +35,7 @@ class Delete extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -34,7 +34,7 @@ class Index extends BaseApi
{
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -33,7 +33,7 @@ class Notification extends BaseApi
{
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$Notifies = DI::notify()->selectAllForUser($uid, 50);

View File

@ -40,7 +40,7 @@ class Seen extends BaseApi
{
protected function post(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
if (DI::args()->getArgc() !== 4) {

View File

@ -46,7 +46,7 @@ class Photo extends BaseApi
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
$type = $this->getRequestValue($this->parameters, 'extension', 'json');

View File

@ -50,7 +50,7 @@ class Create extends BaseApi
protected function post(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
$type = $this->getRequestValue($this->parameters, 'extension', 'json');

View File

@ -52,7 +52,7 @@ class Lists extends BaseApi
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
$type = $this->getRequestValue($this->parameters, 'extension', 'json');

View File

@ -50,7 +50,7 @@ class Update extends BaseApi
protected function post(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
$type = $this->getRequestValue($this->parameters, 'extension', 'json');

View File

@ -36,7 +36,7 @@ class Delete extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -33,7 +33,7 @@ class Index extends BaseApi
{
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$albums = Photo::getAlbums($uid);

View File

@ -52,7 +52,7 @@ class Show extends BaseApi
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
$type = $this->getRequestValue($this->parameters, 'extension', 'json');
$request = $this->getRequest([

View File

@ -34,7 +34,7 @@ class Update extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -36,7 +36,7 @@ class Show extends BaseApi
{
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
// retrieve general information about profiles for user

View File

@ -35,7 +35,7 @@ class Dislike extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -35,7 +35,7 @@ class Undislike extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -37,7 +37,7 @@ class Conversation extends BaseApi
{
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
// params

View File

@ -34,7 +34,7 @@ class Block extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$this->checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -34,7 +34,7 @@ class FeaturedTags extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$this->jsonExit([]);
}

View File

@ -33,7 +33,7 @@ class Follow extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$this->checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -37,7 +37,7 @@ class Followers extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -37,7 +37,7 @@ class Following extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -34,7 +34,7 @@ class IdentityProofs extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$this->jsonExit([]);
}

View File

@ -37,7 +37,7 @@ class Lists extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -33,7 +33,7 @@ class Mute extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$this->checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -34,7 +34,7 @@ class Note extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -36,7 +36,7 @@ class Relationships extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -38,7 +38,7 @@ class Search extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -33,7 +33,7 @@ class Unblock extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$this->checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -33,7 +33,7 @@ class Unfollow extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$this->checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -33,7 +33,7 @@ class Unmute extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$this->checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -36,7 +36,7 @@ class UpdateCredentials extends BaseApi
{
protected function patch(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$owner = User::getOwnerDataById($uid);

View File

@ -37,7 +37,7 @@ class VerifyCredentials extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$self = User::getOwnerDataById($uid);

View File

@ -34,7 +34,7 @@ class Announcements extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
// @todo Possibly use the message from the pageheader addon for this
$this->jsonExit([]);

View File

@ -32,7 +32,7 @@ class VerifyCredentials extends BaseApi
{
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$application = self::getCurrentApplication();
if (empty($application['id'])) {

View File

@ -36,7 +36,7 @@ class Blocks extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -39,7 +39,7 @@ class Bookmarks extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -33,7 +33,7 @@ class Conversations extends BaseApi
{
protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (!empty($this->parameters['id'])) {
@ -51,7 +51,7 @@ class Conversations extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -33,7 +33,7 @@ class Read extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (!empty($this->parameters['id'])) {

View File

@ -41,7 +41,7 @@ class Favourited extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -33,7 +33,7 @@ class Filters extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$this->response->unsupported(Router::POST, $request);
}
@ -43,7 +43,7 @@ class Filters extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$this->jsonExit([]);
}

View File

@ -44,7 +44,7 @@ class FollowRequests extends BaseApi
*/
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$this->checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
$cdata = Contact::getPublicAndUserContactID($this->parameters['id'], $uid);
@ -89,7 +89,7 @@ class FollowRequests extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -32,7 +32,7 @@ class FollowedTags extends BaseApi
{
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -33,7 +33,7 @@ class Lists extends BaseApi
{
protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {
@ -53,7 +53,7 @@ class Lists extends BaseApi
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([
@ -93,7 +93,7 @@ class Lists extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -36,7 +36,7 @@ class Accounts extends BaseApi
{
protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$request = $this->getRequest([
'account_ids' => [], // Array of account IDs to remove from the list
@ -51,7 +51,7 @@ class Accounts extends BaseApi
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$request = $this->getRequest([
'account_ids' => [], // Array of account IDs to add to the list
@ -69,7 +69,7 @@ class Accounts extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -34,7 +34,7 @@ class Markers extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$application = self::getCurrentApplication();
@ -69,7 +69,7 @@ class Markers extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$application = self::getCurrentApplication();

View File

@ -35,7 +35,7 @@ class Media extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([
@ -63,7 +63,7 @@ class Media extends BaseApi
public function put(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([
@ -100,7 +100,7 @@ class Media extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -36,7 +36,7 @@ class Mutes extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -41,7 +41,7 @@ class Notifications extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (!empty($this->parameters['id'])) {

View File

@ -32,7 +32,7 @@ class Clear extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
DI::notification()->setAllDismissedForUser($uid);

View File

@ -34,7 +34,7 @@ class Dismiss extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -36,7 +36,7 @@ class Preferences extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$user = User::getById($uid, ['language', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']);

View File

@ -49,7 +49,7 @@ class PushSubscription extends BaseApi
protected function post(array $request = []): void
{
self::checkAllowedScope(self::SCOPE_PUSH);
$this->checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
$application = self::getCurrentApplication();
@ -83,7 +83,7 @@ class PushSubscription extends BaseApi
public function put(array $request = []): void
{
self::checkAllowedScope(self::SCOPE_PUSH);
$this->checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
$application = self::getCurrentApplication();
@ -122,7 +122,7 @@ class PushSubscription extends BaseApi
protected function delete(array $request = []): void
{
self::checkAllowedScope(self::SCOPE_PUSH);
$this->checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
$application = self::getCurrentApplication();
@ -139,7 +139,7 @@ class PushSubscription extends BaseApi
protected function rawContent(array $request = []): void
{
self::checkAllowedScope(self::SCOPE_PUSH);
$this->checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
$application = self::getCurrentApplication();

View File

@ -51,7 +51,7 @@ class Reports extends BaseApi
public function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$request = $this->getRequest([
'account_id' => '', // ID of the account to report

View File

@ -35,7 +35,7 @@ class ScheduledStatuses extends BaseApi
{
public function put(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$this->response->unsupported(Router::PUT, $request);
@ -43,7 +43,7 @@ class ScheduledStatuses extends BaseApi
protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {
@ -64,7 +64,7 @@ class ScheduledStatuses extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (isset($this->parameters['id'])) {

View File

@ -43,7 +43,7 @@ class Search extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -49,7 +49,7 @@ class Statuses extends BaseApi
{
public function put(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([
@ -164,7 +164,7 @@ class Statuses extends BaseApi
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$request = $this->getRequest([
@ -315,7 +315,7 @@ class Statuses extends BaseApi
protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -35,7 +35,7 @@ class Bookmark extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -35,7 +35,7 @@ class Favourite extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -35,7 +35,7 @@ class Mute extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -34,7 +34,7 @@ class Pin extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -38,7 +38,7 @@ class Reblog extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -37,7 +37,7 @@ class Source extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -35,7 +35,7 @@ class Unbookmark extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -35,7 +35,7 @@ class Unfavourite extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -35,7 +35,7 @@ class Unmute extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -34,7 +34,7 @@ class Unpin extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -37,7 +37,7 @@ class Unreblog extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -36,7 +36,7 @@ class Suggestions extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -36,7 +36,7 @@ class Tags extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['hashtag'])) {

View File

@ -33,7 +33,7 @@ class Follow extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['hashtag'])) {

View File

@ -33,7 +33,7 @@ class Unfollow extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['hashtag'])) {

View File

@ -37,7 +37,7 @@ class Direct extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -41,7 +41,7 @@ class Home extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
$request = $this->getRequest([

View File

@ -41,7 +41,7 @@ class ListTimeline extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {

View File

@ -41,7 +41,7 @@ class Tag extends BaseApi
*/
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty($this->parameters['hashtag'])) {

View File

@ -34,7 +34,7 @@ class UpdateProfile extends BaseApi
{
protected function post(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
$api_user = DI::twitterUser()->createFromUserId($uid, true)->toArray();

View File

@ -35,7 +35,7 @@ class UpdateProfileImage extends BaseApi
{
protected function post(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
// get mediadata from image or media (Twitter call api/account/update_profile_image provides image)

View File

@ -34,7 +34,7 @@ class VerifyCredentials extends BaseApi
{
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
$skip_status = $this->getRequestValue($request, 'skip_status', false);

View File

@ -33,7 +33,7 @@ class Ids extends ContactEndpoint
{
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
// Expected value for user_id parameter: public/user contact id

View File

@ -33,7 +33,7 @@ class Lists extends ContactEndpoint
{
protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
// Expected value for user_id parameter: public/user contact id

View File

@ -42,7 +42,7 @@ abstract class ContactEndpoint extends BaseApi
{
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
self::checkAllowedScope(self::SCOPE_READ);
$this->checkAllowedScope(self::SCOPE_READ);
}
/**

View File

@ -31,7 +31,7 @@ class All extends DirectMessagesEndpoint
{
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
$this->getMessages($request, $uid, []);

View File

@ -31,7 +31,7 @@ class Conversation extends DirectMessagesEndpoint
{
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
$this->getMessages($request, $uid, ["`parent-uri` = ?", $this->getRequestValue($request, 'uri', '')]);

View File

@ -49,7 +49,7 @@ class Destroy extends BaseApi
}
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
$id = $this->getRequestValue($request, 'id', 0);

View File

@ -34,7 +34,7 @@ class Inbox extends DirectMessagesEndpoint
{
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
$pcid = Contact::getPublicIdByUserId($uid);

View File

@ -56,7 +56,7 @@ class NewDM extends BaseApi
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
if (empty($request['text']) || empty($request['screen_name']) && empty($request['user_id'])) {

View File

@ -34,7 +34,7 @@ class Sent extends DirectMessagesEndpoint
{
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
$pcid = Contact::getPublicIdByUserId($uid);

View File

@ -38,7 +38,7 @@ class Favorites extends BaseApi
{
protected function rawContent(array $request = [])
{
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$this->checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
// in friendica starred item are private

View File

@ -34,7 +34,7 @@ class Create extends BaseApi
{
protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$id = $this->getRequestValue($request, 'id', 0);

Some files were not shown because too many files have changed in this diff Show More