diff --git a/RestControllers/postsController.php b/RestControllers/postsController.php index c71e339..1f3f7ec 100644 --- a/RestControllers/postsController.php +++ b/RestControllers/postsController.php @@ -9,6 +9,16 @@ class postsController { + /** + * Access levels for the POST for the api + */ + const ACCESS_LEVEL_API = array( + Posts::NO_ACCESS => "no-access", + Posts::BASIC_ACCESS => "basic", + Posts::INTERMEDIATE_ACCESS => "intermediate", + Posts::FULL_ACCESS => "full" + ); + /** * Get user posts * @@ -39,6 +49,9 @@ class postsController { //Get access level to the post $access_level = CS::get()->components->posts->access_level_with_infos($infos, userID); + //Save level access in the response + $posts[$num]["user_access"] = $this::ACCESS_LEVEL_API[$access_level]; + } return $posts;