mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 22:09:29 +00:00
Get level access to posts
This commit is contained in:
parent
a10c89cd5d
commit
eeb52f669c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user