mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 08:35:18 +00:00
Can get from the API the list of targets where user can create posts
This commit is contained in:
@ -491,6 +491,29 @@ class PostsController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the list of targets (pages) where the current user can create
|
||||
* posts
|
||||
*
|
||||
* @url POST /posts/getAvailableTargets
|
||||
*/
|
||||
public function getAvailableTargets() {
|
||||
user_login_required();
|
||||
|
||||
// Get the list of friends of the user where the user
|
||||
// can create posts
|
||||
$friends = components()->friends->getListThatAllowPostsFromUser(userID);
|
||||
|
||||
// Get the list of groups where the user can create posts
|
||||
$groups = components()->groups->getListUserWhereCanCreatePosts(userID);
|
||||
|
||||
//Return result
|
||||
return array(
|
||||
"friends" => $friends,
|
||||
"groups" => $groups
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the visibility level specified in a POST request
|
||||
*
|
||||
|
Reference in New Issue
Block a user