Use "checkAllowedScope" instead of "login"

This commit is contained in:
Michael 2021-06-08 12:00:22 +00:00
parent 5853fe562d
commit 2a440c0bae
54 changed files with 62 additions and 73 deletions

View file

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

View file

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

View file

@ -34,7 +34,7 @@ class Mute extends BaseApi
{
public static function post(array $parameters = [])
{
self::login(self::SCOPE_WRITE);
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($parameters['id'])) {

View file

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

View file

@ -37,7 +37,7 @@ class Reblog extends BaseApi
{
public static function post(array $parameters = [])
{
self::login(self::SCOPE_WRITE);
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($parameters['id'])) {

View file

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

View file

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

View file

@ -34,7 +34,7 @@ class Unmute extends BaseApi
{
public static function post(array $parameters = [])
{
self::login(self::SCOPE_WRITE);
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($parameters['id'])) {

View file

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

View file

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