add: block list stacks
This commit is contained in:
parent
9bb5f38f76
commit
b71ae1f5a4
28 changed files with 700 additions and 219 deletions
|
@ -145,10 +145,14 @@ impl DataManager {
|
|||
if data.asset_type == AssetType::Post {
|
||||
let post = self.get_post_by_id(data.asset).await?;
|
||||
|
||||
if self
|
||||
if (self
|
||||
.get_userblock_by_initiator_receiver(post.owner, user.id)
|
||||
.await
|
||||
.is_ok()
|
||||
| self
|
||||
.get_user_stack_blocked_users(post.owner)
|
||||
.await
|
||||
.contains(&user.id))
|
||||
&& !user.permissions.check(FinePermission::MANAGE_POSTS)
|
||||
{
|
||||
return Err(Error::NotAllowed);
|
||||
|
@ -156,10 +160,14 @@ impl DataManager {
|
|||
} else if data.asset_type == AssetType::Question {
|
||||
let question = self.get_question_by_id(data.asset).await?;
|
||||
|
||||
if self
|
||||
if (self
|
||||
.get_userblock_by_initiator_receiver(question.owner, user.id)
|
||||
.await
|
||||
.is_ok()
|
||||
| self
|
||||
.get_user_stack_blocked_users(question.owner)
|
||||
.await
|
||||
.contains(&user.id))
|
||||
&& !user.permissions.check(FinePermission::MANAGE_POSTS)
|
||||
{
|
||||
return Err(Error::NotAllowed);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue