func (m *Manager) CheckIfCachingCanBeEnabled(ctx context.Context) error {
	m.lock.RLock()
	defer m.lock.RUnlock()
	return nil
}
CheckIfCachingCanBeEnabled checks if the user can configure caching module
package admin
import (
	"context"
	"net/http"
	"strings"
	"github.com/spaceuptech/helpers"
	"github.com/spaceuptech/space-cloud/gateway/config"
	"github.com/spaceuptech/space-cloud/gateway/model"
	"github.com/spaceuptech/space-cloud/gateway/utils"
)
func (m *Manager) GetInternalAccessToken() (string, error) {
	m.lock.RLock()
	defer m.lock.RUnlock()
	return m.createToken(map[string]interface{}{"id": utils.InternalUserID})
}
func (m *Manager) IsTokenValid(ctx context.Context, token, resource, op string, attr map[string]string) (model.RequestParams, error) {
	m.lock.RLock()
	defer m.lock.RUnlock()
	if !m.isProd {
		return model.RequestParams{}, nil
	}
	claims, err := m.parseToken(ctx, token)
	if err != nil {
		return model.RequestParams{}, err
	}
	res := m.integrationMan.HandleConfigAuth(ctx, resource, op, claims, attr)
	if res.CheckResponse() && res.Error() != nil {
		return model.RequestParams{}, res.Error()
	}
	return model.RequestParams{Resource: resource, Op: op, Attributes: attr, Claims: claims}, nil
}
func (m *Manager) CheckIfAdmin(ctx context.Context, token string) error {
	m.lock.RLock()
	defer m.lock.RUnlock()
	if !m.isProd {
		return nil
	}
	claims, err := m.parseToken(ctx, token)
	if err != nil {
		return err
	}
	role, p := claims["role"]
	if !p {
		return helpers.Logger.LogError(helpers.GetRequestID(ctx), "Invalid token provided. Claim `role` is absent.", nil, nil)
	}
	if !strings.Contains(role.(string), "admin") {
		return helpers.Logger.LogError(helpers.GetRequestID(ctx), "Only admins are authorised to make this request.", nil, nil)
	}
	return nil
}
func (m *Manager) IsDBConfigValid(config config.DatabaseConfigs) error {
	m.lock.RLock()
	defer m.lock.RUnlock()
	var length int
	for _, c := range config {
		if c.Enabled {
			length++
		}
	}
	return nil
}