和顺 / 知白 返回所属 Agent
ZB-02.03

内容使用确认

原能力

记录表达可供谁阅读、可否转述及何时撤回,把限制传给方案编写和交接角色。(细化版 p.2–3)

首选项目

OpenFGA(Apache-2.0)。 OpenFGA

匹配范围

表单记录同意选择,关系元组和 Check 限制被授权读者。

源码

OpenFGA · func (s *Server) Check(

pkg/server/check.go · 37–50 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
func (s *Server) Check(ctx context.Context, req *openfgav1.CheckRequest) (*openfgav1.CheckResponse, error) {
	const methodName = "check"

	startTime := time.Now()

	tk := req.GetTupleKey()
	ctx, span := tracer.Start(ctx, apimethod.Check.String(), trace.WithAttributes(
		attribute.KeyValue{Key: "store_id", Value: attribute.StringValue(req.GetStoreId())},
		attribute.KeyValue{Key: "object", Value: attribute.StringValue(tk.GetObject())},
		attribute.KeyValue{Key: "relation", Value: attribute.StringValue(tk.GetRelation())},
		attribute.KeyValue{Key: "user", Value: attribute.StringValue(tk.GetUser())},
		attribute.KeyValue{Key: "consistency", Value: attribute.StringValue(req.GetConsistency().String())},
	))
	defer span.End()

OpenFGA · func (s *Server) Write(

pkg/server/write.go · 26–39 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
func (s *Server) Write(ctx context.Context, req *openfgav1.WriteRequest) (*openfgav1.WriteResponse, error) {
	start := time.Now()

	ctx, span := tracer.Start(ctx, apimethod.Write.String(), trace.WithAttributes(
		attribute.String("store_id", req.GetStoreId()),
	))
	defer span.End()

	if !validator.RequestIsValidatedFromContext(ctx) {
		if err := req.Validate(); err != nil {
			return nil, status.Error(codes.InvalidArgument, err.Error())
		}
	}

SurveyJS Form Library · class SurveyModel

packages/survey-core/src/survey.ts · 241–254 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
export class SurveyModel extends SurveyElementCore
  implements
  ISurvey,
  ISurveyData,
  ISurveyVariables,
  ISurveyDataGetEditingObj,
  ISurveyImpl,
  ISurveyTriggerOwner,
  ISurveyErrorOwner,
  ISurveyTimerText {
  public static readonly TemplateRendererComponentName: string =
    "sv-template-renderer";
  // public static get cssType(): string {
  //   return surveyCss.currentType;

实现与验收要点

用途、可转述范围、授权版本、撤回后的派生报告追踪。