Small fixes for trust center
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -2941,7 +2941,7 @@ func (r *queryResolver) Viewer(ctx context.Context) (*types.Viewer, error) {
|
||||
|
||||
// TrustCenters is the resolver for the trustCenters field.
|
||||
func (r *queryResolver) TrustCenters(ctx context.Context, first *int, after *page.CursorKey, last *int, before *page.CursorKey, filter *types.TrustCenterFilter) (*types.TrustCenterConnection, error) {
|
||||
panic(fmt.Errorf("not implemented: TrustCenters - trustCenters"))
|
||||
return nil, fmt.Errorf("not implemented: TrustCenters - trustCenters")
|
||||
}
|
||||
|
||||
// DownloadURL is the resolver for the downloadUrl field.
|
||||
|
||||
@@ -46,8 +46,8 @@ func GetCurrentUserRole(ctx context.Context, accessor ContextAccessor) types.Rol
|
||||
return types.RoleNone
|
||||
}
|
||||
|
||||
func MustBeAuthenticatedDirective(accessor ContextAccessor) func(ctx context.Context, obj interface{}, next graphql.Resolver, role *types.Role) (interface{}, error) {
|
||||
return func(ctx context.Context, obj interface{}, next graphql.Resolver, role *types.Role) (interface{}, error) {
|
||||
func MustBeAuthenticatedDirective(accessor ContextAccessor) func(ctx context.Context, obj any, next graphql.Resolver, role *types.Role) (any, error) {
|
||||
return func(ctx context.Context, obj any, next graphql.Resolver, role *types.Role) (any, error) {
|
||||
currentRole := GetCurrentUserRole(ctx, accessor)
|
||||
|
||||
if role != nil && *role == types.RoleUser && currentRole == types.RoleNone {
|
||||
|
||||
Reference in New Issue
Block a user