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