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

@ -54,3 +54,7 @@ func GetGinContextRole(c *gin.Context) Role {
return RoleVisitor
}
}
func IsAdminRoleContext(c *gin.Context) bool {
return GetGinContextRole(c) == RoleAdministrator
}