fix: feature gate some guest features in the backend
This commit is contained in:
parent
39750c1d82
commit
226c2e02b5
3 changed files with 33 additions and 0 deletions
|
|
@ -53,6 +53,13 @@ pub async fn assign_slot(
|
|||
Path(slug): Path<String>,
|
||||
Json(req): Json<AssignSlotRequest>,
|
||||
) -> Result<Json<AvatarWithPaths>, AppError> {
|
||||
// Guests cannot customize their avatar
|
||||
if user.is_guest() {
|
||||
return Err(AppError::Forbidden(
|
||||
"Avatar customization is disabled for guests, please register first.".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
req.validate()?;
|
||||
|
||||
let mut conn = rls_conn.acquire().await;
|
||||
|
|
@ -93,6 +100,13 @@ pub async fn clear_slot(
|
|||
Path(slug): Path<String>,
|
||||
Json(req): Json<ClearSlotRequest>,
|
||||
) -> Result<Json<AvatarWithPaths>, AppError> {
|
||||
// Guests cannot customize their avatar
|
||||
if user.is_guest() {
|
||||
return Err(AppError::Forbidden(
|
||||
"Avatar customization is disabled for guests, please register first.".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
req.validate()?;
|
||||
|
||||
let mut conn = rls_conn.acquire().await;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue