func (m *Module) Profiles(ctx context.Context, token, dbAlias, project string) (int, map[string]interface{}, error) {
	if !m.IsEnabled() {
		return http.StatusNotFound, nil, errors.New("This feature isn't enabled")
	}
	find := map[string]interface{}{}
	req := &model.ReadRequest{Find: find, Operation: utils.All}
	actions, reqParams, err := m.auth.IsReadOpAuthorised(ctx, project, dbAlias, "users", token, req, model.ReturnWhereStub{})
	if err != nil {
		return http.StatusForbidden, nil, err
	}
	res, _, err := m.crud.Read(ctx, dbAlias, "users", req, reqParams)
	if err != nil {
		return http.StatusInternalServerError, nil, err
	}
	_ = authHelpers.PostProcessMethod(ctx, m.aesKey, actions, res)
	if usersArray, ok := res.([]interface{}); ok {
		for _, user := range usersArray {
			userObj := user.(map[string]interface{})
			delete(userObj, "pass")
		}
	}
	return http.StatusOK, map[string]interface{}{"users": res}, nil
}
Profiles fetches all the user profiles
package userman
import (
	"context"
	"errors"
	"fmt"
	"net/http"
	"github.com/spaceuptech/helpers"
	"golang.org/x/crypto/bcrypt"
	uuid "github.com/satori/go.uuid"
	"github.com/spaceuptech/space-cloud/gateway/model"
	authHelpers "github.com/spaceuptech/space-cloud/gateway/modules/auth/helpers"
	"github.com/spaceuptech/space-cloud/gateway/utils"
)
func (m *Module) Profile(ctx context.Context, token, dbAlias, project, id string) (int, map[string]interface{}, error) {
	if !m.IsEnabled() {
		return http.StatusNotFound, nil, errors.New("This feature isn't enabled")
	}
	find := map[string]interface{}{}
	actualDbType, err := m.crud.GetDBType(dbAlias)
	if err != nil {
		return 0, nil, err
	}
	switch model.DBType(actualDbType) {
	case model.Mongo, model.EmbeddedDB:
		find["_id"] = id
	default:
		find["id"] = id
	}
	req := &model.ReadRequest{Find: find, Operation: utils.One}
	actions, reqParams, err := m.auth.IsReadOpAuthorised(ctx, project, dbAlias, "users", token, req, model.ReturnWhereStub{})
	if err != nil {
		return http.StatusForbidden, nil, err
	}
	res, _, err := m.crud.Read(ctx, dbAlias, "users", req, reqParams)
	if err != nil {
		return http.StatusInternalServerError, nil, err
	}
	_ = authHelpers.PostProcessMethod(ctx, m.aesKey, actions, res)
	delete(res.(map[string]interface{}), "pass")
	return http.StatusOK, res.(map[string]interface{}), nil
}