Get level access to posts

This commit is contained in:
Pierre 2018-01-09 06:49:13 +01:00
parent a10c89cd5d
commit eeb52f669c

View File

@ -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;