fixed some pelling mistakes
Dieser Commit ist enthalten in:
Ursprung
2fff12e6f4
Commit
608bc051d2
|
@ -18,11 +18,11 @@ const (
|
||||||
|
|
||||||
var rauthmap = map[Rauth]string{
|
var rauthmap = map[Rauth]string{
|
||||||
ReqAuthAbsent: "Authentication Absent",
|
ReqAuthAbsent: "Authentication Absent",
|
||||||
ReqAuthRequired: "Authntication Required",
|
ReqAuthRequired: "Authentication Required",
|
||||||
ReqAuthUnspec: "Authentication irrelevant",
|
ReqAuthUnspec: "Authentication irrelevant",
|
||||||
}
|
}
|
||||||
|
|
||||||
// String is to Statisfy th Stringer interface
|
// String is to Statisfy the Stringer interface
|
||||||
func (r *Rauth) String() string {
|
func (r *Rauth) String() string {
|
||||||
return rauthmap[*r]
|
return rauthmap[*r]
|
||||||
}
|
}
|
||||||
|
@ -78,10 +78,10 @@ func (m *MenuItem) Children() []Menu {
|
||||||
// Enabled returns always true
|
// Enabled returns always true
|
||||||
func (m *MenuItem) Enabled(a auth.Account) bool {
|
func (m *MenuItem) Enabled(a auth.Account) bool {
|
||||||
switch m.RequireAuth {
|
switch m.RequireAuth {
|
||||||
case ReqAuthAbsent:
|
|
||||||
return true && a.Anonymous()
|
|
||||||
case ReqAuthUnspec:
|
case ReqAuthUnspec:
|
||||||
return true
|
return true
|
||||||
|
case ReqAuthAbsent:
|
||||||
|
return true && a.Anonymous()
|
||||||
case ReqAuthRequired:
|
case ReqAuthRequired:
|
||||||
return true && !a.Anonymous()
|
return true && !a.Anonymous()
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ func gencases(t *testing.T) []Case {
|
||||||
seen: true && !authenticated,
|
seen: true && !authenticated,
|
||||||
}
|
}
|
||||||
cases = append(cases, c)
|
cases = append(cases, c)
|
||||||
t.Logf("Absent Case, athenticated: %t, seen: %t", authenticated, c.seen)
|
t.Logf("Absent Case, authenticated: %t, seen: %t", authenticated, c.seen)
|
||||||
case menus.ReqAuthRequired:
|
case menus.ReqAuthRequired:
|
||||||
c := Case{
|
c := Case{
|
||||||
menu: menus.MenuItem{
|
menu: menus.MenuItem{
|
||||||
|
@ -61,7 +61,7 @@ func gencases(t *testing.T) []Case {
|
||||||
seen: true && authenticated,
|
seen: true && authenticated,
|
||||||
}
|
}
|
||||||
cases = append(cases, c)
|
cases = append(cases, c)
|
||||||
t.Logf("Required Case, athenticated: %t, seen: %t", authenticated, c.seen)
|
t.Logf("Required Case, authenticated: %t, seen: %t", authenticated, c.seen)
|
||||||
case menus.ReqAuthUnspec:
|
case menus.ReqAuthUnspec:
|
||||||
c := Case{
|
c := Case{
|
||||||
menu: menus.MenuItem{
|
menu: menus.MenuItem{
|
||||||
|
@ -71,7 +71,7 @@ func gencases(t *testing.T) []Case {
|
||||||
seen: true,
|
seen: true,
|
||||||
}
|
}
|
||||||
cases = append(cases, c)
|
cases = append(cases, c)
|
||||||
t.Logf("Uspec Case, athenticated: %t, seen: %t", authenticated, c.seen)
|
t.Logf("Unspec Case, authenticated: %t, seen: %t", authenticated, c.seen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ func (m *Middleware) Teardown() {
|
||||||
|
|
||||||
func logmigrations(version int32, name string, dir string, sql string) {
|
func logmigrations(version int32, name string, dir string, sql string) {
|
||||||
sql = ""
|
sql = ""
|
||||||
log.Info().Int32("version", version).Str("name", name).Str("dir", dir).Msgf("Running Migration %s with version %i in %sward direction", name, version, dir)
|
log.Info().Int32("version", version).Str("name", name).Str("dir", dir).Msgf("Running Migration %s with version %d in %sward direction", name, version, dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetupMigrator sets up the migrator to migrate the database.
|
// SetupMigrator sets up the migrator to migrate the database.
|
||||||
|
|
Laden…
In neuem Issue referenzieren