feat: expand companion platform, device controls, and memoir workflows
ci / verify (push) Canceled after 0s
ci / verify (push) Canceled after 0s
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package saas
|
||||
|
||||
import (
|
||||
"context"
|
||||
"data-terminal-cloud/internal/callmemory"
|
||||
"data-terminal-cloud/internal/identity"
|
||||
"github.com/jackc/pgx/v5"
|
||||
)
|
||||
|
||||
func (s *Service) checkMemoryGrant(ctx context.Context, q interface {
|
||||
QueryRow(context.Context, string, ...any) pgx.Row
|
||||
}, p identity.Principal, id string, write bool) error {
|
||||
var elder, sensitivity string
|
||||
if e := q.QueryRow(ctx, `SELECT sp.public_id::text,cm.sensitivity FROM curated_memory cm JOIN subject_profile sp ON sp.id=cm.subject_id WHERE cm.public_id=$1::uuid`, id).Scan(&elder, &sensitivity); e != nil {
|
||||
return ErrAccessDenied
|
||||
}
|
||||
a, e := callmemory.ResolveAccess(ctx, q, p, elder, write)
|
||||
if e != nil || (!a.Sensitive && sensitivity != "normal") {
|
||||
return ErrAccessDenied
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user