Enabled likes on posts

This commit is contained in:
Pierre 2018-01-04 17:42:40 +01:00
parent 7f6ac13d7d
commit debbdbc7ca

View File

@ -44,9 +44,23 @@ class likesController {
break; break;
//In case of post
case "post":
//Extract informations
$id = getPostPostID("id");
$componentType = Likes::LIKE_POST;
//Check user can see the post
if(CS::get()->components->posts->access_level($id, userID) === Posts::NO_ACCESS)
Rest_fatal_error(401, "You are not allowed to access this post informations !");
break;
//Default case : error //Default case : error
default: default:
Rest_fatal_error(404, "Didn't find specified component type !"); Rest_fatal_error(404, "Specifed component type currently not supported !");
} }
//Update like status //Update like status