mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-12-25 13:08:58 +00:00
Added special visibility level for group members.
This commit is contained in:
parent
0dff74f987
commit
a0c750f5eb
@ -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",
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -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 (";
|
||||
|
Loading…
Reference in New Issue
Block a user