Update to new goprogram version
This commit is contained in:
parent
7bd9570bc0
commit
873fdcd5c2
106 changed files with 478 additions and 825 deletions
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
type AdminLoggedIn struct {
|
||||
component.Base
|
||||
Dependencies struct {
|
||||
dependencies struct {
|
||||
Auth *auth.Auth
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,6 @@ func (*AdminLoggedIn) Scope() component.ScopeInfo {
|
|||
}
|
||||
|
||||
func (al *AdminLoggedIn) HasScope(param string, r *http.Request) (bool, error) {
|
||||
_, user, err := al.Dependencies.Auth.SessionOf(r)
|
||||
_, user, err := al.dependencies.Auth.SessionOf(r)
|
||||
return user != nil && user.IsAdmin() && user.IsTOTPEnabled(), err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
type ListInstancesScope struct {
|
||||
component.Base
|
||||
Dependencies struct {
|
||||
dependencies struct {
|
||||
Auth *auth.Auth
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,6 @@ func (*ListInstancesScope) Scope() component.ScopeInfo {
|
|||
}
|
||||
|
||||
func (lis *ListInstancesScope) HasScope(param string, r *http.Request) (bool, error) {
|
||||
_, user, err := lis.Dependencies.Auth.SessionOf(r)
|
||||
_, user, err := lis.dependencies.Auth.SessionOf(r)
|
||||
return user != nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
type Never struct {
|
||||
component.Base
|
||||
Dependencies struct {
|
||||
dependencies struct {
|
||||
Auth *auth.Auth
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
type ListNewsScope struct {
|
||||
component.Base
|
||||
Dependencies struct {
|
||||
dependencies struct {
|
||||
Auth *auth.Auth
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,6 @@ func (*ListNewsScope) Scope() component.ScopeInfo {
|
|||
}
|
||||
|
||||
func (lns *ListNewsScope) HasScope(param string, r *http.Request) (bool, error) {
|
||||
_, user, err := lns.Dependencies.Auth.SessionOf(r)
|
||||
_, user, err := lns.dependencies.Auth.SessionOf(r)
|
||||
return user != nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
type ResolverScope struct {
|
||||
component.Base
|
||||
Dependencies struct {
|
||||
dependencies struct {
|
||||
Auth *auth.Auth
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,6 @@ func (*ResolverScope) Scope() component.ScopeInfo {
|
|||
}
|
||||
|
||||
func (rs *ResolverScope) HasScope(param string, r *http.Request) (bool, error) {
|
||||
_, user, err := rs.Dependencies.Auth.SessionOf(r)
|
||||
_, user, err := rs.dependencies.Auth.SessionOf(r)
|
||||
return user != nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
type UserLoggedIn struct {
|
||||
component.Base
|
||||
Dependencies struct {
|
||||
dependencies struct {
|
||||
Auth *auth.Auth
|
||||
}
|
||||
}
|
||||
|
|
@ -31,6 +31,6 @@ func (*UserLoggedIn) Scope() component.ScopeInfo {
|
|||
}
|
||||
|
||||
func (iu *UserLoggedIn) HasScope(param string, r *http.Request) (bool, error) {
|
||||
_, user, err := iu.Dependencies.Auth.SessionOf(r)
|
||||
_, user, err := iu.dependencies.Auth.SessionOf(r)
|
||||
return user != nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue