chore: user permissions

This commit is contained in:
Noah Hsu
2022-06-29 18:03:12 +08:00
parent 3c7a2f78cf
commit d24e51bc86
11 changed files with 110 additions and 48 deletions

View File

@ -60,13 +60,3 @@ func AuthAdmin(c *gin.Context) {
c.Next()
}
}
func AuthManage(c *gin.Context) {
user := c.MustGet("user").(*model.User)
if user.CanWrite() {
c.Next()
return
}
common.ErrorStrResp(c, "You have no write access", 403)
c.Abort()
}