MCPcopy Create free account
hub / github.com/kataras/iris / IsAdmin

Function IsAdmin

_examples/auth/jwt/tutorial/api/auth.go:132–140  ·  view source on GitHub ↗

IsAdmin reports whether the current client has admin access.

(ctx iris.Context)

Source from the content-addressed store, hash-verified

130
131// IsAdmin reports whether the current client has admin access.
132func IsAdmin(ctx iris.Context) bool {
133 for _, role := range GetClaims(ctx).Roles {
134 if role == model.Admin {
135 return true
136 }
137 }
138
139 return false
140}

Callers 2

GetTodoFunction · 0.85
AllowAdminFunction · 0.85

Calls 1

GetClaimsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…