func (s Store) Find(ctx context.Context, id int) (*entity.Permission, error) {
	var permission entity.Permission
	err := s.db.GetContext(ctx, &permission, "SELECT * FROM permissions WHERE id = ? LIMIT 1", id)
	return &permission, errors.WithStack(checkNotFound(err))
}
Find finds the entity by id.
package permission
import (
	"context"
	"database/sql"
	"go-webapp-example/internal/pkg/entity"
	"go-webapp-example/pkg/clock"
	"go-webapp-example/pkg/db"
	"github.com/pkg/errors"
)
type authManager interface {
	PermissionsForUser(id int) [][]string
	PermissionsForRole(id int) [][]string
}
type Store struct {
	db    *db.Connection
	auth  authManager
	clock *clock.Clock
}
func NewStore(conn *db.Connection, authManager authManager, opts ...func(s *Store)) *Store {
	s := &Store{db: conn, auth: authManager}
	for _, opt := range opts {
		opt(s)
	}
	return s
}