mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 08:25:16 +00:00
Can create movie posts
This commit is contained in:
@ -18,7 +18,7 @@ use crate::data::group::GroupAccessLevel;
|
||||
use crate::data::group_id::GroupID;
|
||||
use crate::data::post::{Post, PostAccessLevel};
|
||||
use crate::data::user::UserID;
|
||||
use crate::helpers::{account_helper, api_helper, conversations_helper, friends_helper, groups_helper, posts_helper, user_helper, virtual_directory_helper};
|
||||
use crate::helpers::{account_helper, api_helper, conversations_helper, friends_helper, groups_helper, movies_helper, posts_helper, user_helper, virtual_directory_helper};
|
||||
use crate::helpers::virtual_directory_helper::VirtualDirType;
|
||||
use crate::utils::string_utils::{check_url, remove_html_nodes};
|
||||
use crate::utils::user_data_utils::{generate_new_user_data_file_name, prepare_file_creation, user_data_path};
|
||||
@ -561,4 +561,15 @@ impl HttpRequestHandler {
|
||||
|
||||
Ok(post)
|
||||
}
|
||||
|
||||
/// Get the ID of a movie included in the request
|
||||
pub fn post_movie_id(&mut self, name: &str) -> ResultBoxError<u64> {
|
||||
let movie_id = self.post_u64(name)?;
|
||||
|
||||
if !movies_helper::does_user_has(self.user_id_ref()?, movie_id)? {
|
||||
self.forbidden("You are not authorized to use this movie!".to_string())?;
|
||||
}
|
||||
|
||||
Ok(movie_id)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user