backend: priviliges

This commit is contained in:
Alex
2025-02-20 13:19:41 +01:00
parent 03b3683b63
commit 3493e83e84
2 changed files with 14 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ func (mc *MembershipController) RegisterSubscription(c *gin.Context) {
return
}
if !utils.HasPrivilige(requestUser, constants.Priviliges.Update) {
if !utils.HasPrivilige(requestUser, constants.Priviliges.Create) {
utils.RespondWithError(c, errors.ErrNotAuthorized, "Not allowed to register subscription", http.StatusForbidden, "user.user", "server.error.unauthorized")
return
}
@@ -118,7 +118,7 @@ func (mc *MembershipController) DeleteSubscription(c *gin.Context) {
return
}
if !utils.HasPrivilige(requestUser, constants.Priviliges.Update) {
if !utils.HasPrivilige(requestUser, constants.Priviliges.Delete) {
utils.RespondWithError(c, errors.ErrNotAuthorized, "Not allowed to update subscription", http.StatusForbidden, "user.user", "server.error.unauthorized")
return
}