diff --git a/RestControllers/postsController.php b/RestControllers/postsController.php index 1f3f7ec..aa07e6a 100644 --- a/RestControllers/postsController.php +++ b/RestControllers/postsController.php @@ -9,6 +9,15 @@ class postsController { + /** + * Visibility levels for the API + */ + const VISIBILITY_LEVELS_API = array( + Posts::VISIBILITY_PUBLIC => "public", + Posts::VISIBILITY_FRIENDS => "friends", + Posts::VISIBILITY_USER => "private" + ); + /** * Access levels for the POST for the api */ @@ -52,6 +61,9 @@ class postsController { //Save level access in the response $posts[$num]["user_access"] = $this::ACCESS_LEVEL_API[$access_level]; + //Update visibility level + $posts[$num]['visibility_level'] = $this::VISIBILITY_LEVELS_API[$infos['visibility_level']]; + } return $posts;