add: require that users keep supporter status for profilestyle products
This commit is contained in:
parent
59378a4447
commit
bcee3f7763
2 changed files with 15 additions and 7 deletions
|
@ -1098,10 +1098,19 @@ impl DataManager {
|
|||
let mut out = Vec::new();
|
||||
|
||||
for config in &user.applied_configurations {
|
||||
let product = match self.get_product_by_id(config.1).await {
|
||||
Ok(x) => x,
|
||||
Err(_) => continue,
|
||||
};
|
||||
let product = self.get_product_by_id(config.1).await?;
|
||||
let owner = self.get_user_by_id_with_void(product.owner).await?;
|
||||
|
||||
if config.0 == AppliedConfigType::StyleSnippet
|
||||
&& !owner.permissions.check(FinePermission::SUPPORTER)
|
||||
{
|
||||
out.push(format!(
|
||||
"<script>console.warn(\"{} has stopped their supporter subscription, so this applied configuration no longer works.\");</script>",
|
||||
owner.username
|
||||
));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
out.push(match config.0 {
|
||||
AppliedConfigType::StyleSnippet => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue