package permissions

import (
	"context"

	"github.com/nexuscrm/shared/pkg/models"
)

type folderTypePermissionRepo struct {
	saveTestRepo
	systemPerms map[string]bool
	customPerms map[string]bool
}

func (r *folderTypePermissionRepo) GetEffectiveSystemPermissions(context.Context, string, string) (map[string]bool, error) {
	return cloneBoolMap(r.systemPerms), nil
}

func (r *folderTypePermissionRepo) GetEffectiveCustomPermissions(context.Context, string, string) (map[string]bool, error) {
	return cloneBoolMap(r.customPerms), nil
}

func (r *folderTypePermissionRepo) GetAllRoles(context.Context) ([]*models.UserRole, error) {
	return nil, nil
}

func cloneBoolMap(in map[string]bool) map[string]bool {
	out := make(map[string]bool, len(in))
	for key, value := range in {
		out[key] = value
	}
	return out
}
