mirror of
https://github.com/vcscsvcscs/GenerationsHeritage.git
synced 2025-08-14 06:49:05 +02:00
add auth func
This commit is contained in:
@@ -1 +1,14 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/neo4j/neo4j-go-driver/v5/neo4j"
|
||||
"github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/internal/memgraph"
|
||||
)
|
||||
|
||||
func userWithIdHasAccessToGivenPerson(ctx context.Context, session neo4j.SessionWithContext, userId, personId int) bool {
|
||||
_, err := session.ExecuteRead(ctx, memgraph.GetPersonById(ctx, userId))
|
||||
|
||||
return err == nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user