diff --git a/RestControllers/PostsController.php b/RestControllers/PostsController.php index 7e647eb..50032d2 100644 --- a/RestControllers/PostsController.php +++ b/RestControllers/PostsController.php @@ -15,7 +15,8 @@ class PostsController { const VISIBILITY_LEVELS_API = array( Posts::VISIBILITY_PUBLIC => "public", Posts::VISIBILITY_FRIENDS => "friends", - Posts::VISIBILITY_USER => "private" + Posts::VISIBILITY_USER => "private", + Posts::VISIBILITY_GROUP_MEMBERS => "members", ); /** diff --git a/classes/components/posts.php b/classes/components/posts.php index 434ab49..dd0ae4d 100644 --- a/classes/components/posts.php +++ b/classes/components/posts.php @@ -19,6 +19,9 @@ class Posts { //Posts that can be seen by the user only const VISIBILITY_USER = 3; + //Posts that can be seen by the members of a group (same as friends) + const VISIBILITY_GROUP_MEMBERS = 50; + /** * Access level to a post */ @@ -175,7 +178,7 @@ class Posts { } //Get user visibility level - $visibilityLevel = $all_posts ? $this::VISIBILITY_USER : $this::VISIBILITY_PUBLIC; + $visibilityLevel = $all_posts ? $this::VISIBILITY_GROUP_MEMBERS : $this::VISIBILITY_PUBLIC; //Prepare the request on the database $conditions = "WHERE group_id = ? AND (";