fix: make reposts of nsfw posts nsfw
chore: update permission management uis
This commit is contained in:
parent
c49e4458e2
commit
7b4865333e
5 changed files with 11 additions and 3 deletions
|
@ -348,6 +348,7 @@
|
|||
REQUESTED: 1 << 6,
|
||||
MANAGE_PINS: 1 << 7,
|
||||
MANAGE_COMMUNITY: 1 << 8,
|
||||
MANAGE_QUESTIONS: 1 << 9,
|
||||
},
|
||||
],
|
||||
);
|
||||
|
|
|
@ -230,6 +230,8 @@
|
|||
BANNED: 1 << 17,
|
||||
INFINITE_COMMUNITIES: 1 << 18,
|
||||
SUPPORTER: 1 << 19,
|
||||
MANAGE_REQUESTS: 1 << 20,
|
||||
MANAGE_QUESTIONS: 1 << 21,
|
||||
},
|
||||
],
|
||||
);
|
||||
|
|
|
@ -270,7 +270,7 @@ macro_rules! auto_method {
|
|||
if !user.permissions.check(FinePermission::$permission) {
|
||||
return Err(Error::NotAllowed);
|
||||
} else {
|
||||
self.create_audit_log_entry(crate::model::moderation::AuditLogEntry::new(
|
||||
self.create_audit_log_entry($crate::model::moderation::AuditLogEntry::new(
|
||||
user.id,
|
||||
format!("invoked `{}` with x value `{x}`", stringify!($name)),
|
||||
))
|
||||
|
@ -303,7 +303,7 @@ macro_rules! auto_method {
|
|||
if !user.permissions.check(FinePermission::$permission) {
|
||||
return Err(Error::NotAllowed);
|
||||
} else {
|
||||
self.create_audit_log_entry(crate::model::moderation::AuditLogEntry::new(
|
||||
self.create_audit_log_entry($crate::model::moderation::AuditLogEntry::new(
|
||||
user.id,
|
||||
format!("invoked `{}` with x value `{id}`", stringify!($name), id),
|
||||
))
|
||||
|
|
|
@ -652,6 +652,11 @@ impl DataManager {
|
|||
if let Some(ref rt) = reposting {
|
||||
data.context.reposts_enabled = false; // cannot repost reposts
|
||||
|
||||
// mirror nsfw status
|
||||
if rt.context.is_nsfw {
|
||||
data.context.is_nsfw = true;
|
||||
}
|
||||
|
||||
// make sure we aren't trying to repost a repost
|
||||
if if let Some(ref repost) = rt.context.repost {
|
||||
repost.reposting.is_some()
|
||||
|
|
|
@ -247,7 +247,7 @@ impl DataManager {
|
|||
{
|
||||
// requests are also deleted when a post is created answering the given question
|
||||
// (unless the question is global)
|
||||
self.delete_request(y.owner, y.id, &user).await?;
|
||||
self.delete_request(y.owner, y.id, user).await?;
|
||||
}
|
||||
|
||||
// return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue