This commit is contained in:
Daniel 2024-07-07 22:39:53 +08:00
parent c9dcfafc68
commit 4e9b0bc6c6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 15 additions and 5 deletions

View file

@ -324,9 +324,7 @@ func CheckAuth(c *gin.Context) {
}
func CheckAdminRole(c *gin.Context) {
if IsValidRole(GetGinContextRole(c), []Role{
RoleAdministrator,
}) {
if IsAdminRoleContext(c) {
c.Next()
} else {
c.AbortWithStatus(http.StatusForbidden)