Skip to content

Commit

Permalink
Allow to create a permission with expires_at
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Jan 15, 2025
1 parent 80e643d commit bf120d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web/permissions/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ func createPermission(c echo.Context) error {
tiny = false
}
}
} else {
tiny = false
if at, ok := subdoc.ExpiresAt.(string); ok {
expires, err := time.Parse(time.RFC3339, at)
if err != nil {
return jsonapi.InvalidAttribute("expires_at", err)
}
expiresAt = &expires
}
}

var codes map[string]string
Expand Down

0 comments on commit bf120d0

Please sign in to comment.