Updated visibility levels

This commit is contained in:
Pierre 2018-01-10 06:59:28 +01:00
parent 6378dc95ee
commit 9e82720491

View File

@ -9,6 +9,15 @@
class postsController { 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 * Access levels for the POST for the api
*/ */
@ -52,6 +61,9 @@ class postsController {
//Save level access in the response //Save level access in the response
$posts[$num]["user_access"] = $this::ACCESS_LEVEL_API[$access_level]; $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; return $posts;