From 9e82720491fbe31dc740f8e5858b8956ee248120 Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 10 Jan 2018 06:59:28 +0100 Subject: [PATCH] Updated visibility levels --- RestControllers/postsController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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;