Add dynamic admin panel for managing entities (#108)
This commit is contained in:
parent
60009df0bf
commit
1a6874fd82
47 changed files with 2173 additions and 320 deletions
|
|
@ -28,6 +28,9 @@ type (
|
|||
// IsAuth stores whether the user is authenticated.
|
||||
IsAuth bool
|
||||
|
||||
// IsAdmin stores whether the user is an admin.
|
||||
IsAdmin bool
|
||||
|
||||
// AuthUser stores the authenticated user.
|
||||
AuthUser *ent.User
|
||||
|
||||
|
|
@ -77,6 +80,7 @@ func NewRequest(ctx echo.Context) *Request {
|
|||
if u := ctx.Get(context.AuthenticatedUserKey); u != nil {
|
||||
p.IsAuth = true
|
||||
p.AuthUser = u.(*ent.User)
|
||||
p.IsAdmin = p.AuthUser.Admin
|
||||
}
|
||||
|
||||
if cfg := ctx.Get(context.ConfigKey); cfg != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue