Added special visibility level for group members.

This commit is contained in:
Pierre HUBERT 2018-07-17 09:55:03 +02:00
parent 0dff74f987
commit a0c750f5eb
2 changed files with 6 additions and 2 deletions

View File

@ -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",
);
/**

View File

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